aboutsummaryrefslogtreecommitdiffhomepage
path: root/backend/game/models.go
blob: 6c299d69a74d9fc7d3685796794bd7316187fd88 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package game

import (
	"time"

	"github.com/nsfisis/iosdc-japan-2024-albatross/backend/api"
)

type gameState = api.GameState

const (
	gameStateClosed         gameState = api.Closed
	gameStateWaitingEntries gameState = api.WaitingEntries
	gameStateWaitingStart   gameState = api.WaitingStart
	gameStatePrepare        gameState = api.Prepare
	gameStateStarting       gameState = api.Starting
	gameStateGaming         gameState = api.Gaming
	gameStateFinished       gameState = api.Finished
)

type game struct {
	gameID          int
	state           gameState
	displayName     string
	durationSeconds int
	startedAt       *time.Time
	problem         *problem
}

type problem struct {
	problemID   int
	title       string
	description string
}