Feat: switch team; team model
This commit is contained in:
@ -31,19 +31,26 @@ func StrToWordColor(s string) WordColor {
|
||||
}
|
||||
}
|
||||
|
||||
type Team struct {
|
||||
Guessers []string
|
||||
Mime string
|
||||
}
|
||||
|
||||
type Room struct {
|
||||
ID string `json:"id" db:"id"`
|
||||
CreatedAt time.Time `json:"created_at" db:"created_at"`
|
||||
// RoomName string `json:"room_name"`
|
||||
RoomPass string `json:"room_pass"`
|
||||
RoomLink string
|
||||
CreatorName string `json:"creator_name"`
|
||||
PlayerList []string `json:"player_list"`
|
||||
TeamTurn string
|
||||
RedMime string
|
||||
BlueMime string
|
||||
RedGuessers []string
|
||||
BlueGuessers []string
|
||||
RoomPass string `json:"room_pass"`
|
||||
RoomLink string
|
||||
CreatorName string `json:"creator_name"`
|
||||
PlayerList []string `json:"player_list"`
|
||||
TeamTurn string
|
||||
RedTeam Team
|
||||
BlueTeam Team
|
||||
// RedMime string
|
||||
// BlueMime string
|
||||
// RedGuessers []string
|
||||
// BlueGuessers []string
|
||||
Cards []WordCard
|
||||
GameSettings *GameSettings `json:"settings"`
|
||||
Result uint8 // 0 for unknown; 1 is win for red; 2 if for blue;
|
||||
|
@ -75,13 +75,15 @@ func MakeTestState() *FullInfo {
|
||||
{Word: "tomato", Color: "red"},
|
||||
{Word: "cloud", Color: "white"},
|
||||
}
|
||||
redTeam := Team{Guessers: []string{"Adam", "Eve"}, Mime: "Serpent"}
|
||||
blueTeam := Team{Guessers: []string{"Abel", "Kain"}}
|
||||
room := &Room{
|
||||
ID: "test-id",
|
||||
CreatedAt: time.Now(),
|
||||
CreatorName: "test-name",
|
||||
Cards: cards,
|
||||
RedGuessers: []string{"Adam", "Eve"},
|
||||
BlueGuessers: []string{"Abel", "Kain"},
|
||||
ID: "test-id",
|
||||
CreatedAt: time.Now(),
|
||||
CreatorName: "test-name",
|
||||
Cards: cards,
|
||||
RedTeam: redTeam,
|
||||
BlueTeam: blueTeam,
|
||||
}
|
||||
us := &UserState{
|
||||
Username: "test-name",
|
||||
|
Reference in New Issue
Block a user