![]() |
BomberUnits
...a Unity learning project
|
Responsible for managing a single match. More...
Inheritance diagram for MatchManager:
Collaboration diagram for MatchManager:Public Types | |
| enum | MatchState { init, running, gameOver } |
Public Member Functions | |
| Player | GetWinningPlayer () |
| void | Start () |
| void | OnDestroy () |
Static Public Member Functions | |
| static MatchManager | Get () |
Public Attributes | |
| GameObject [] | spawnTiles |
Private Member Functions | |
| void | Awake () |
| void | OnPlayerDeath (PlayerIdNetData data) |
| Upon each players death, the clients update the players status and assess whether the game has ended. More... | |
| void | CheckForMatchEnd () |
| Each players current status is held within its player information. More... | |
| void | SendPlayerSpawnInfo () |
| Sends information on player figure spawn locations. More... | |
Private Attributes | |
| MatchState | state |
| float | drawSimultaneousDeathTolerance = 0.05f |
| Player | winningPlayer |
Static Private Attributes | |
| static MatchManager | instance |
| Singleton pattern instance, not persistent! | |
Responsible for managing a single match.
Is thus part of each level scene and destroyed with it. The static singleton access can therefore not be guaranteed to return a valid object!
Definition at line 11 of file MatchManager.cs.
|
strong |
Definition at line 16 of file MatchManager.cs.
|
inlineprivate |
Definition at line 65 of file MatchManager.cs.
|
inlineprivate |
Each players current status is held within its player information.
A reference to the winnings player is filled if the match result was not a draw. The player deaths are synchronized over clients, so the evaluation needs not to.
Definition at line 122 of file MatchManager.cs.
|
inlineprivate |
Upon each players death, the clients update the players status and assess whether the game has ended.
Invoke the match end check a bit later, if multiple players died at about the same time. Will be invoked multiple times as well in that case, debounced by the Match State itself.
Definition at line 104 of file MatchManager.cs.
|
inlineprivate |
Sends information on player figure spawn locations.
This currently commences the game! These are randomized if set as such in the settings.
Definition at line 148 of file MatchManager.cs.
|
inline |
Definition at line 78 of file MatchManager.cs.