Feat: roomlist & join room
This commit is contained in:
		| @@ -52,6 +52,7 @@ type Room struct { | ||||
| 	BlueCounter uint8 | ||||
| 	RedCounter  uint8 | ||||
| 	RedTurn     bool // false is blue turn | ||||
| 	IsPublic    bool | ||||
| 	// GameSettings *GameSettings `json:"settings"` | ||||
| 	IsRunning bool   `json:"is_running"` | ||||
| 	Language  string `json:"language" example:"en" form:"language"` | ||||
| @@ -102,6 +103,12 @@ func (r *Room) ChangeTurn() { | ||||
| 	} | ||||
| } | ||||
|  | ||||
| func (r *Room) RevealAllCards() { | ||||
| 	for i := range r.Cards { | ||||
| 		r.Cards[i].Revealed = true | ||||
| 	} | ||||
| } | ||||
|  | ||||
| type WordCard struct { | ||||
| 	Word     string | ||||
| 	Color    WordColor | ||||
| @@ -142,4 +149,5 @@ func (rr *RoomReq) CreateRoom(creator string) *Room { | ||||
| type FullInfo struct { | ||||
| 	State *UserState | ||||
| 	Room  *Room | ||||
| 	List  []*Room | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Grail Finder
					Grail Finder