Ejemplo n.º 1
0
        public void MoveToken(int diceNumber)
        {
            _tokenService.MoveToken(_token, diceNumber);

            if (_token.IsWinner())
            {
                // This is normally an message event raised into Game class.
                OnWinEvent?.Invoke(this, null);
            }
        }
Ejemplo n.º 2
0
 private void OnCollisionEnter(Collision collision)
 {
     if (collision.gameObject.tag == "Enemy")
     {
         isCatched = true;
         OnGameOverEvent?.Invoke();
     }
     if (collision.gameObject.tag == "Finish")
     {
         isCatched = true;
         OnWinEvent?.Invoke();
     }
 }
Ejemplo n.º 3
0
 public void EndGame()
 {
     OnWinEvent?.Invoke();
     gameEnded = true;
 }