1package game 2 3import "encoding/json" 4 5type GameResult int16 6 7const ( 8 HumansByVote GameResult = iota 9 HumansByTask 10 ImpostorByVote 11 ImpostorByKill 12 ImpostorBySabotage 13 ImpostorDisconnect 14 HumansDisconnect 15 Unknown 16) 17 18func (r *Gameover) Marshal() ([]byte, error) { 19 return json.Marshal(r) 20} 21 22type Gameover struct { 23 GameOverReason GameResult `json:"GameOverReason"` 24 PlayerInfos []PlayerInfo `json:"PlayerInfos"` 25} 26 27type PlayerInfo struct { 28 Name string `json:"Name"` 29 IsImpostor bool `json:"IsImpostor"` 30} 31 32type GameRole int16 33 34const ( 35 CrewmateRole GameRole = iota 36 ImposterRole 37) 38