2019-09-02 18:42:27 -06:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
2020-02-29 16:51:32 -07:00
|
|
|
"io"
|
2019-09-02 19:47:24 -06:00
|
|
|
"time"
|
2019-09-02 18:42:27 -06:00
|
|
|
)
|
|
|
|
|
2020-02-29 16:51:32 -07:00
|
|
|
type Category struct {
|
2020-02-29 22:37:22 -07:00
|
|
|
Name string
|
2020-02-29 16:51:32 -07:00
|
|
|
Puzzles []int
|
2019-09-02 19:47:24 -06:00
|
|
|
}
|
|
|
|
|
2020-02-29 16:51:32 -07:00
|
|
|
type ReadSeekCloser interface {
|
|
|
|
io.Reader
|
|
|
|
io.Seeker
|
|
|
|
io.Closer
|
2019-09-02 18:42:27 -06:00
|
|
|
}
|
2019-09-02 19:47:24 -06:00
|
|
|
|
2020-02-29 16:51:32 -07:00
|
|
|
type PuzzleProvider interface {
|
2020-03-01 14:03:46 -07:00
|
|
|
Open(cat string, points int, path string) (ReadSeekCloser, error)
|
|
|
|
ModTime(cat string, points int, path string) (time.Time, error)
|
2020-02-29 16:51:32 -07:00
|
|
|
Inventory() []Category
|
|
|
|
}
|
|
|
|
|
|
|
|
type ThemeProvider interface {
|
|
|
|
Open(path string) (ReadSeekCloser, error)
|
|
|
|
ModTime(path string) (time.Time, error)
|
|
|
|
}
|
|
|
|
|
2020-02-29 22:37:22 -07:00
|
|
|
type StateExport struct {
|
|
|
|
Messages string
|
|
|
|
TeamNames map[string]string
|
|
|
|
PointsLog []Award
|
|
|
|
}
|
|
|
|
|
2020-02-29 16:51:32 -07:00
|
|
|
type StateProvider interface {
|
2020-02-29 22:37:22 -07:00
|
|
|
Export(teamId string) *StateExport
|
2020-03-01 14:03:46 -07:00
|
|
|
TeamName(teamId string) (string, error)
|
2020-02-29 22:37:22 -07:00
|
|
|
SetTeamName(teamId, teamName string) error
|
2020-02-29 16:51:32 -07:00
|
|
|
}
|
|
|
|
|
|
|
|
type Component interface {
|
|
|
|
Update()
|
2019-11-24 15:58:43 -07:00
|
|
|
}
|