Exemple #1
0
        public bool Equals(ITetromino x, ITetromino y)
        {
            if (x == null || y == null)
            {
                return(x == null && y == null);
            }

            return(x.Type == y.Type &&
                   x.Locked == y.Locked &&
                   Enumerable.SequenceEqual(m_GameRules.GetTetrominoPoints(x), m_GameRules.GetTetrominoPoints(y)));
        }
 private bool TestTetromino(TetrominoType tetrominoType, Vec2 pos, int angle)
 {
     foreach (var p in m_GameRules.GetTetrominoPoints(tetrominoType, pos, angle))
     {
         if (m_Board.Get(p.x, p.y) != TetrominoType.Empty)
         {
             return(false);
         }
     }
     return(true);
 }