From 56c94c39877dadbb25bc0e10d432ddaefe75d4b6 Mon Sep 17 00:00:00 2001 From: Grail Finder Date: Sat, 3 May 2025 07:57:22 +0300 Subject: [PATCH] feat: add models/state.go --- models/state.go | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 models/state.go diff --git a/models/state.go b/models/state.go new file mode 100644 index 0000000..440602b --- /dev/null +++ b/models/state.go @@ -0,0 +1,21 @@ +package models + +type UserTeam string + +const ( + UserTeamBlue = "blue" + UserTeamRed = "red" + UserTeamNone = "none" +) + +func StrToUserTeam(s string) WordColor { + switch s { + case "blue": + return UserTeamBlue + // finish this switch; ai! + +// every gohtml page should be recreated on reload in the needed state +type UserState struct { + Username string + Room RoomPublic +}