Documentation
¶
Index ¶
- type Configer
- type Funcs
- type Matcher
- func (m *Matcher) AddMode(mode constant.GameMode, funcs *Funcs)
- func (m *Matcher) GetFuncs(mode constant.GameMode) *Funcs
- func (m *Matcher) GetMatcher(key string) *glicko2.Matcher
- func (m *Matcher) Lock()
- func (m *Matcher) Match(g glicko2.Group)
- func (m *Matcher) NewMatcher(key string, argsFunc func() *glicko2.QueueArgs, ...) (matcher *glicko2.Matcher, err error)
- func (m *Matcher) RLock()
- func (m *Matcher) RUnlock()
- func (m *Matcher) Stop()
- func (m *Matcher) Unlock()
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Funcs ¶
type Funcs struct { ArgsFunc func() *glicko2.QueueArgs NewTeamFunc func(group glicko2.Group) glicko2.Team NewRoomFunc func(team glicko2.Team) glicko2.Room NewRoomWithAIFunc func(team glicko2.Team) glicko2.Room }
Funcs is the funcs needed for glicko2 matcher.
type Matcher ¶
type Matcher struct { // for debug ErrCount int RoomCount atomic.Int64 // contains filtered or unexported fields }
Matcher is the glicko2 matcher.
func New ¶
func New( roomChannelToService chan entry.Room, configer *Configer, matchInterval time.Duration, playerMgr *repository.PlayerMgr, groupMgr *repository.GroupMgr, teamMgr *repository.TeamMgr, roomMgr *repository.RoomMgr, ) *Matcher
New returns the new glicko2 matcher, and start it.
func (*Matcher) GetMatcher ¶
GetMatcher returns the matcher of the given key.
func (*Matcher) NewMatcher ¶
func (m *Matcher) NewMatcher( key string, argsFunc func() *glicko2.QueueArgs, newTeamFunc func(group glicko2.Group) glicko2.Team, newRoomFunc, newRoomWithAIFunc func(team glicko2.Team) glicko2.Room, ) (matcher *glicko2.Matcher, err error)
NewMatcher returns the new matcher of the given key, if the key exists, it will return the existing one. `key` is used to separate different matching groups.
Click to show internal directories.
Click to hide internal directories.