Draft: big refactor

This commit is contained in:
2025-09-16 16:03:27 +08:00
parent f527230f1e
commit c4f2b0af25
42 changed files with 684 additions and 215 deletions

27
types/game.go Normal file
View File

@@ -0,0 +1,27 @@
package types
import "fmt"
type RoomStatus int
const (
RoomStatusWaiting RoomStatus = iota
RoomStatusPlaying
RoomStatusEnded
)
var (
RoomStatusStr = []string{"Waiting", "Playing", "Ended"}
)
type Room struct {
Creater string
Status RoomStatus
}
func (self Room) View() string {
return fmt.Sprintf("%10s [%s]",
self.Creater,
RoomStatusStr[self.Status],
)
}