Chore: remove unused WCMap
This commit is contained in:
		| @@ -4,6 +4,7 @@ import ( | ||||
| 	"errors" | ||||
| 	"fmt" | ||||
| 	"gralias/utils" | ||||
| 	"strings" | ||||
| 	"time" | ||||
|  | ||||
| 	"github.com/rs/xid" | ||||
| @@ -146,15 +147,24 @@ type Room struct { | ||||
| 	TeamWon        UserTeam  `db:"team_won"` | ||||
| 	RoomLink       string    `db:"room_link"` | ||||
| 	// fields not in db | ||||
| 	ActionHistory []Action             `db:"-"` | ||||
| 	RedTeam       Team                 `db:"-"` | ||||
| 	BlueTeam      Team                 `db:"-"` | ||||
| 	Cards         []WordCard           `db:"-"` | ||||
| 	WCMap         map[string]WordColor `db:"-"` | ||||
| 	BotMap        map[string]BotPlayer `db:"-"` | ||||
| 	Mark          CardMark             `db:"-"` | ||||
| 	LogJournal    []string             `db:"-"` | ||||
| 	Settings      GameSettings         `db:"-"` | ||||
| 	ActionHistory []Action   `db:"-"` | ||||
| 	RedTeam       Team       `db:"-"` | ||||
| 	BlueTeam      Team       `db:"-"` | ||||
| 	Cards         []WordCard `db:"-"` | ||||
| 	// WCMap         map[string]WordColor `db:"-"` | ||||
| 	BotMap     map[string]BotPlayer `db:"-"` | ||||
| 	Mark       CardMark             `db:"-"` | ||||
| 	LogJournal []string             `db:"-"` | ||||
| 	Settings   GameSettings         `db:"-"` | ||||
| } | ||||
|  | ||||
| func (r *Room) FindColor(word string) (WordColor, bool) { | ||||
| 	for _, card := range r.Cards { | ||||
| 		if strings.EqualFold(card.Word, word) { | ||||
| 			return card.Color, true | ||||
| 		} | ||||
| 	} | ||||
| 	return "", false | ||||
| } | ||||
|  | ||||
| func (r *Room) ClearMarks() { | ||||
| @@ -386,13 +396,13 @@ type WordCard struct { | ||||
|  | ||||
| // table: settings | ||||
| type GameSettings struct { | ||||
| 	ID              uint32    `json:"id" db:"id"` | ||||
| 	RoomID          string    `db:"room_id"` | ||||
| 	Language        string    `json:"language" example:"en" form:"language" db:"language"` | ||||
| 	RoomPass        string    `json:"room_pass" db:"room_pass"` | ||||
| 	 | ||||
| 	RoundTime       uint32    `json:"round_time" db:"turn_time"` | ||||
| 	CreatedAt       time.Time `db:"created_at"` | ||||
| 	ID       uint32 `json:"id" db:"id"` | ||||
| 	RoomID   string `db:"room_id"` | ||||
| 	Language string `json:"language" example:"en" form:"language" db:"language"` | ||||
| 	RoomPass string `json:"room_pass" db:"room_pass"` | ||||
|  | ||||
| 	RoundTime uint32    `json:"round_time" db:"turn_time"` | ||||
| 	CreatedAt time.Time `db:"created_at"` | ||||
| } | ||||
|  | ||||
| // ===== | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Grail Finder
					Grail Finder