private void Handle(MatchEnded request) { CurrentMatch.Ended = true; SendMatchChangedToParent(); Context.Stop(Self); }
private void MatchEnd(string endMessage) { StopCoroutine(Timer()); MatchEnded?.Invoke(endMessage); GameManager.LevelManager.ResetLevel(); //StartCoroutine(ToLevelSelect()); }
/* When all zombies are killed, the wave has finished */ private void OnZombieKilled() { foreach (var z in FindObjectsOfType <Zombie>()) { if (z != null && z.Health > 0) { return; } } if (mGameState == EGameState.Wave && CharacterInst.Health > 0) { MatchEnded.Invoke(); SwitchState(EGameState.FinishedWave); StartCoroutine(FinishedWaveTimer()); } }
/// <summary> /// This creates a match and starts it immediately /// </summary> /// <param name="player1"></param> /// <param name="player2"></param> /// <param name="callback">The function called when the match is over</param> public Match(IRPSPlayer player1, IRPSPlayer player2, MatchEnded callback) { this.player1 = player1; this.player2 = player2; playerOneHealth = player1.health; playerTwoHealth = player2.health; player1Choices = new LinkedList<RPS>(); player2Choices = new LinkedList<RPS>(); this.callback = callback; player1.startMatch(this); player2.startMatch(this); newRound(); }
private void ChangeMatchState(int matchId, StateEnum state) { //db UoW.MatchRepo.UpdateMatchState(matchId, state); //ui switch (state) { case StateEnum.Confirmed: break; case StateEnum.Playing: MatchStarted?.Invoke(matchId); break; case StateEnum.Ended: MatchEnded?.Invoke(matchId); break; default: break; } }
protected virtual void OnMatchEnded(object source, EventArgs e) { MatchEnded?.Invoke(source, e); }
protected virtual void OnMatchEnd(EventArgs e) { MatchEnded?.Invoke(this, e); }