Documentation
¶
Index ¶
- func CalcTeamsBase(database *sql.DB) (z float64, err error)
- func LastAccept(teamID int, flags []db.Flag) int64
- type ByScoreAndLastAccept
- type CategoryInfo
- type Game
- func (g Game) OpenNextTask(t db.Task) (err error)
- func (g Game) RecalcScoreboard() (err error)
- func (g Game) Run() (err error)
- func (g Game) Scoreboard() (scores []TeamScoreInfo, err error)
- func (g *Game) SetTaskPrice(p500, p400, p300, p200 int)
- func (g *Game) SetTeamsBase(teams int)
- func (g Game) Solve(teamID, taskID int, flag string) (solved bool, err error)
- func (g Game) Tasks() (cats []CategoryInfo, err error)
- func (g *Game) TeamsBaseUpdater(database *sql.DB, updateTimeout time.Duration)
- type TaskInfo
- type TeamScoreInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CalcTeamsBase ¶
CalcTeamsBase calculate abstract amout of teams
Types ¶
type ByScoreAndLastAccept ¶
type ByScoreAndLastAccept []TeamScoreInfo
ByScoreAndLastAccept sort by score and last accept
func (ByScoreAndLastAccept) Len ¶
func (tr ByScoreAndLastAccept) Len() int
func (ByScoreAndLastAccept) Less ¶
func (tr ByScoreAndLastAccept) Less(i, j int) bool
func (ByScoreAndLastAccept) Swap ¶
func (tr ByScoreAndLastAccept) Swap(i, j int)
type CategoryInfo ¶
CategoryInfo provide information about categories and tasks
type Game ¶
type Game struct { Start time.Time End time.Time OpenTimeout time.Duration // after solve task AutoOpen bool AutoOpenTimeout time.Duration // if task does not solved TaskPrice struct { TeamsBase float64 P500, P400, P300, P200 float64 } // contains filtered or unexported fields }
Game struct
func (Game) OpenNextTask ¶
OpenNextTask open next task by level
func (Game) RecalcScoreboard ¶
RecalcScoreboard update scoreboard
func (Game) Scoreboard ¶
func (g Game) Scoreboard() (scores []TeamScoreInfo, err error)
Scoreboard returns sorted scoreboard
func (*Game) SetTaskPrice ¶
SetTaskPrice convert and set price of tasks
func (*Game) SetTeamsBase ¶
SetTeamsBase force set amount of teams for calc price task
func (Game) Tasks ¶
func (g Game) Tasks() (cats []CategoryInfo, err error)
Tasks returns categories with tasks
Click to show internal directories.
Click to hide internal directories.