Exemplo n.º 1
0
func New() *Game {
	return &Game{
		ActivePlayer:   player.NewCorp(),
		InactivePlayer: player.NewRunner(),
		CorpCredits:    5,
		RunnerCredits:  5,
		Clicks:         0,
	}
}
Exemplo n.º 2
0
func TestToJson(t *testing.T) {
	game := &Game{
		ActivePlayer:   player.NewCorp(),
		InactivePlayer: player.NewRunner(),
		CorpCredits:    5,
		RunnerCredits:  5,
		Clicks:         0,
	}

	expectedJson := "{\"ActivePlayer\":{\"Role\":\"corp\"},\"InactivePlayer\":{\"Role\":\"runner\"},\"CorpCredits\":5,\"RunnerCredits\":5,\"Clicks\":0}"
	assert.Equal(t, game.ToJson(), expectedJson)
}