Closed lafkob closed 8 years ago
Questions:
1) Do you mean ready to make moves, or putting the game into the database for the first time? At the very first startup, the game needs (per the model) board gameId playerOneId gameStatus
Everything else is nullable. The board...could be nullable, but it just seemed easier to make it right at the start. Adding a new player won't change what state it's in.
As an aside, to the longs and ints need to be wrapped so they can be nullable? As is, I keep them all as -1, as that's not a valid value for any of them.
2) I think I will remove START altogether. It would not be too difficult to add in later, and we're not going to do anything with it at the moment. It referred to players having time to move their pieces around. WAITING_FOR_PLAYERS is the state the game starts in.
Re starting a game: I meant what is the state when we have a user click new game? I was preferring null to invalid values, but either way there will be a check. With null, I guess it is explicit in the database that there is no value, rather than one intended to mean base state.
Figure out a way to serialize the games into the database as well as restore them. Build a dao for doing this. This is how we should store the games between requests (maybe with caching in there to help with speed if we have time).