I'm making a collectible card game like hearthstone. I'd like to save players, hand, deck, and minions for server side validation and persistence (in case of disconnect). Ideally I want to save a 'room' and state where I'm reading and writing to it. I think I would save it in json format as follows.
{ room: someid,
state: [ {player1Id: PlayFabId,
health: 30
deck: Id's,
hand: Id's,
board: [array of minions]
}, {player2Id:PlayFabId,
health: 30
deck: Id's,
hand: Id's,
board: [array of minions]
}
]
}
What is the most optimal way for updating/editing this information?
1. Player plays a card from hand, remove card from hand
2. Card creates a minion, add minion to player's board
3. Player1 uses minion to attack Player2 minion
Am I right in thinking to use one json string to represent the data? and if so, where should I store it (Title Data) ?
Thank you for your time.