Documentation ¶
Index ¶
- func CloseDB()
- func CountMatchesByDifficulty(diff difficulty.Difficulty, after time.Time) (n int64, err error)
- func FillPlayersWithELO(players []*GamePlayer)
- func GetMatchWithFeedsAsCSV(writer io.Writer) (err error)
- func GetMatchesAverageUPS(after time.Time) (n float64, err error)
- func GetMatchesAverageUPSAll(after time.Time) (n []float64, err error)
- func InsertMatch(match *Match) error
- func OpenDB(path string)
- func ResetELO() (err error)
- func ShouldUpdateELO() (update bool, err error)
- func UpdateELO() (err error)
- type Channel
- type EmptyModel
- type Event
- type EventType
- type Evo
- type Force
- type GamePlayer
- type MVPplayer
- type MVPquery
- type Match
- type MatchPlayerCount
- type Model
- type Player
- type Team
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CountMatchesByDifficulty ¶
func CountMatchesByDifficulty(diff difficulty.Difficulty, after time.Time) (n int64, err error)
func FillPlayersWithELO ¶
func FillPlayersWithELO(players []*GamePlayer)
func GetMatchWithFeedsAsCSV ¶
func GetMatchesAverageUPSAll ¶
func InsertMatch ¶
func ShouldUpdateELO ¶
Types ¶
type EmptyModel ¶
type EmptyModel struct {
ID uint `gorm:"primaryKey" json:"-"`
}
type GamePlayer ¶
type GamePlayer struct { EmptyModel PlayerID uint `json:"-"` Player *Player `json:",omitempty"` Force Force MatchID uint `gorm:"index" json:"-"` Match *Match `json:",omitempty"` BeforeELO int GainELO int `json:",omitempty"` TeamID uint `json:"-"` }
func QueryPlayerMatchesShort ¶
func QueryPlayerMatchesShort(name string) (gp []*GamePlayer, err error)
type MVPquery ¶
func QueryGlobalMVP ¶
type Match ¶
type Match struct { Model Players []*GamePlayer `gorm:"foreignkey:MatchID" json:",omitempty"` South, North *Team `gorm:"foreignkey:MatchID" json:",omitempty"` Start time.Time `gorm:"uniqueIndex" json:",omitempty"` End time.Time `gorm:"index" json:",omitempty"` Length time.Duration Winner Force Difficulty difficulty.Difficulty `sql:"type:difficulty"` Timeline []*Event `gorm:"foreignkey:MatchID" json:",omitempty"` ChannelID string `json:"-"` }
func QueryMatchAll ¶
func QueryMatchLong ¶
func QueryMatchShort ¶
func (*Match) UpdateMatchELO ¶
func (m *Match) UpdateMatchELO()
type MatchPlayerCount ¶
func GetAllMatchesPlayerCount ¶
func GetAllMatchesPlayerCount(after time.Time) (n []MatchPlayerCount, err error)
type Player ¶
type Player struct { EmptyModel Name string `gorm:"unique"` ELO int `gorm:"default:800;index:,sort:desc"` History []*GamePlayer `gorm:"foreignkey:PlayerID" json:",omitempty"` }
func QueryPlayerByName ¶
func QueryTopPlayersByELO ¶
type Team ¶
type Team struct { EmptyModel Players []*GamePlayer `gorm:"foreignkey:TeamID" json:",omitempty"` MVPs []*MVPplayer `gorm:"many2many:mvp_team;" json:",omitempty"` AvgELO float64 TotalFeed science.Feed `gorm:"type:integer[]"` FinalEVO float32 FinalThreat int IsNorth bool `gorm:"type:bool" json:"-"` MatchID uint `gorm:"index" json:"-"` }
func (*Team) IsPlayerInTeam ¶
Click to show internal directories.
Click to hide internal directories.