Hi Jano,
Looking at your Dominion implementation to understand best practices on using boardgame.io. In your utils.js your are doing
let buyCard = (state, ctx, player, card) => {
if (state.custom_onClickBoard) {
state = state.custom_onClickBoard(state, ctx, player, card);
} else if (player.treasure >= card.cost) {
// if the player has treasure to play
player.treasure -= card.cost;
player.buy--;
player.discard.push(card);
card.count--;
}
return state
Are you considering the player changes immutable? Or you don't care?
Thanks
R
Hi Jano, Looking at your Dominion implementation to understand best practices on using boardgame.io. In your utils.js your are doing
Are you considering the player changes immutable? Or you don't care? Thanks R