Esempio n. 1
0
func New() *Game {
	return &Game{
		ActivePlayer:   player.NewCorp(),
		InactivePlayer: player.NewRunner(),
		CorpCredits:    5,
		RunnerCredits:  5,
		Clicks:         0,
	}
}
Esempio 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)
}