instance.go 493 B

1234567891011121314151617181920
  1. package matchbase
  2. type MatchInstance interface {
  3. GetStatus() int
  4. IsFull() bool
  5. IsUserEnrolled(userId int) bool
  6. RegisterReceiver(receiver MatchInstanceReceiver)
  7. GetWinners() []int
  8. GetAllMatchUsers() []MatchUser
  9. SendNotification(userId int, data string)
  10. GetUserList() []int
  11. GetUser(userId int) *MatchUser
  12. }
  13. type MatchInstanceReceiver interface {
  14. OnMatchStart(matchNo int)
  15. OnMatchEnd(matchNo int)
  16. OnMatchCancelled(matchNo int)
  17. OnUserEliminated(matchNo int, userId int, rank int)
  18. }