game replace, game list

This commit is contained in:
Bel LaPointe
2021-03-12 07:16:11 -06:00
parent aaf4ff3161
commit 21ab31b30d
7 changed files with 108 additions and 54 deletions

View File

@@ -16,10 +16,10 @@ type Game struct {
}
type Player struct {
ID string
Name string
Card string
Balance Currency
ID string `json:",omitempty"`
Name string `json:",omitempty"`
Card string `json:",omitempty"`
Balance Currency `json:",omitempty"`
}
type Currency int
@@ -34,12 +34,6 @@ func (game Game) GetPlayers() []Player {
return players
}
func (players Players) MarshalJSON() ([]byte, error) {
game := Game{Players: players}
subplayers := game.GetPlayers()
return json.Marshal(subplayers)
}
func (p Player) Empty() bool {
return p == (Player{})
}