game replace, game list
This commit is contained in:
@@ -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{})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user