Example #1
0
 /// <summary>
 /// Desenha a entidade.
 /// </summary>
 /// <param name="gameTime">Obtém o acesso aos tempos de jogo.</param>
 /// <param name="spriteBatch">Uma instância de SpriteBatch para desenhar na tela.</param>
 public void Draw(GameTime gameTime, SpriteBatch spriteBatch)
 {
     if (IsVisible)
     {
         OnDraw(gameTime, spriteBatch);
         OnDrawEvent?.Invoke(this, gameTime, spriteBatch);
     }
 }
Example #2
0
        bool IGameoverHandler.IsGameover(GameManager game)
        {
            bool       isGameover = false;
            Vector2Int move       = game.PrevPlacedPiece;

            TrackFilledColumns(move.Col());

            if (IsDrawGame())
            {
                isGameover = true;

                OnDrawEvent?.Invoke();
            }
            else if (IsWinner(move.Row(), move.Col()))
            {
                isGameover = true;

                OnWonEvent?.Invoke();
            }

            return(isGameover);
        }