Esempio n. 1
0
 public FadingPiece(Piece.pieceTypes pieceType, bool flooded)
     : base(pieceType, flooded)
 {
 }
Esempio n. 2
0
 public void Clear()
 {
     for (int c = 0; c < width; c++)
         for (int r = 0; r < height; r++)
             board[c, r] = new Piece(Piece.pieceTypes.EMPTY);
 }
Esempio n. 3
0
 public bool ConnectedOnSide(int c, int r, Piece.sides side)
 {
     return board[c, r].ConnectedOnSide(side);
 }
Esempio n. 4
0
 public void AddFallingPiece(int c, int r, Piece.pieceTypes type, int vertOffset)
 {
     fallingPieces[c.ToString() + "_" + r.ToString()] = new FallingPiece(type, vertOffset);
 }
Esempio n. 5
0
 public void AddRotatingPiece(int c, int r, Piece.pieceTypes type, bool clkwise)
 {
     rotatingPieces[c.ToString() + "_" + r.ToString()] = new RotatingPiece(type, clkwise);
 }
Esempio n. 6
0
 public void AddFadingPiece(int c, int r, Piece.pieceTypes type)
 {
     fadingPieces[c.ToString() + "_" + r.ToString()] = new FadingPiece(type, true);
 }
Esempio n. 7
0
 public void SetPieceType(int c, int r, Piece.pieceTypes type)
 {
     board[c, r].SetPiece(type);
 }
Esempio n. 8
0
        public void PropogateFlooding(int c, int r, Piece.sides dir)
        {
            if ((c >= 0) && (c < GameBoard.width) && (r >= 0) && (r < GameBoard.height))
            {
                if (board[c, r].ConnectedOnSide(dir) && !board[c, r].Flooded)
                {
                    board[c, r].Flooded = true;
                    FloodTracker.Add(new Vector2(c, r));

                    foreach (Piece.sides side in board[c, r].GetOtherConnections(dir))
                    {
                        switch (side)
                        {
                            case Piece.sides.LEFT:
                                PropogateFlooding(c - 1, r, Piece.sides.RIGHT);
                                break;

                            case Piece.sides.TOP:
                                PropogateFlooding(c, r - 1, Piece.sides.BOTTOM);
                                break;

                            case Piece.sides.RIGHT:
                                PropogateFlooding(c + 1, r, Piece.sides.LEFT);
                                break;

                            case Piece.sides.BOTTOM:
                                PropogateFlooding(c, r + 1, Piece.sides.TOP);
                                break;
                        }
                    }
                }
            }
        }
Esempio n. 9
0
 public RotatingPiece(Piece.pieceTypes pieceType, bool clkwise)
     : base(pieceType)
 {
     this.clkwise = clkwise;
 }
Esempio n. 10
0
 public FallingPiece(Piece.pieceTypes pieceType, int vertOffset)
     : base(pieceType)
 {
     this.vertOffset = vertOffset;
 }