Represents a tournament within a lobby, when given a matching strategy, it matches players according to that strategy, runs the games between matched players and broadcasts game stats

### Hierarchy

- Tournament

## Index

### Constructors

- constructor

### Properties

- lobbyToken
- matchmaker
- options
- player
- players
- socket

### Methods

- continue
- getStats
- isFinished
- onGameInit
- onGameMove
- playMatch
- playMatches
- playTournament
- sendStats
- start
- updateStats

### Object literals

- stats

## Constructors

### constructor

- new Tournament(options: ITournamentOptions, socket: SocketServer, players: Player[], lobbyToken: string): Tournament

- - Defined in tournament/Tournament.ts:36

  #### Parameters

  - ##### options: ITournamentOptions

  - ##### socket: SocketServer

  - ##### players: Player[]

  - ##### lobbyToken: string

  #### Returns Tournament

## Properties

### Private lobbyToken

lobbyToken: string

- Defined in tournament/Tournament.ts:38

### Private matchmaker

matchmaker: IMatchmaker

- Defined in tournament/Tournament.ts:36

### Private options

options: ITournamentOptions

- Defined in tournament/Tournament.ts:38

### Private player

player: Player[]

- Defined in tournament/Tournament.ts:29

### players

players: Player[]

- Defined in tournament/Tournament.ts:38

### Private socket

socket: SocketServer

- Defined in tournament/Tournament.ts:38

## Methods

### continue

- continue(): Promise<void>

- - Defined in tournament/Tournament.ts:67

  #### Returns Promise<void>

### getStats

- getStats(): object

- - Defined in tournament/Tournament.ts:81

  #### Returns object

  - ##### finished: boolean

  - ##### matches: object[]

  - ##### options: ITournamentOptions

  - ##### ranking: string[]

  - ##### started: boolean

  - ##### waiting: boolean

### isFinished

- isFinished(): boolean

- - Defined in tournament/Tournament.ts:77

  #### Returns boolean

### Private onGameInit

- onGameInit(): void

- - Defined in tournament/Tournament.ts:133

  #### Returns void

### Private onGameMove

- onGameMove(move: IMove): void

- - Defined in tournament/Tournament.ts:137

  #### Parameters

  - ##### move: IMove

  #### Returns void

### Private playMatch

- playMatch(match: Match): Promise<void>

- - Defined in tournament/Tournament.ts:93

  #### Parameters

  - ##### match: Match

  #### Returns Promise<void>

### playMatches

- playMatches(matches: Match[]): Promise<void>

- - Defined in tournament/Tournament.ts:71

  #### Parameters

  - ##### matches: Match[]

  #### Returns Promise<void>

### Private playTournament

- playTournament(): Promise<void>

- - Defined in tournament/Tournament.ts:97

  #### Returns Promise<void>

### Private sendStats

- sendStats(): void

- - Defined in tournament/Tournament.ts:129

  #### Returns void

### start

- start(): Promise<void>

- - Defined in tournament/Tournament.ts:60

  #### Returns Promise<void>

### Private updateStats

- updateStats(): void

- - Defined in tournament/Tournament.ts:117

  #### Returns void

## Object literals

### Private stats

stats: object

- Defined in tournament/Tournament.ts:30

### finished

finished: false = false

- Defined in tournament/Tournament.ts:31

### matches

matches: undefined[] = []

- Defined in tournament/Tournament.ts:32

### started

started: false = false

- Defined in tournament/Tournament.ts:33

### waiting

waiting: false = false

- Defined in tournament/Tournament.ts:34

Generated using TypeDoc