Create a parameterized view? #5059
Unanswered
homersimpsons
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
I'm trying to create a card game. Players should know their cards but not the one of the other players. Players can play multiple games at the same time. How best to modelize this?
In a classic server/rest approach I would have a
/game/:idthat would return something similar as (for Player1):So Player0 has hidden card for Player1. But player1 still knows Player0 has 3 cards and can see his owns cards.
But with spacetimedb:
gameStatetable then both players would be able to know everythinggameStatetable private and use a view I cannot specify which gameid I want to fetchCurrently, what I'm doing is that I have a single ongoing game and hence my view returns the (filtered) current ongoing game:
Another issue with my current approach: as soon as the game finished it is no longer an ongoing game, and hence displaying post game results is harder than if I could follow the game session with just the id.
Note that from what I can see in BitCraft there is a bunch of tables which are declared
public: https://github.com/search?q=repo%3Aclockworklabs%2FBitCraftPublic%20spacetimedb%3A%3Atable&type=codeBeta Was this translation helpful? Give feedback.
All reactions