Exemplo n.º 1
0
 public FadingPiece(Piece.pieceTypes pieceType, bool flooded)
     : base(pieceType, flooded)
 {
 }
Exemplo 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);
 }
Exemplo n.º 3
0
 public bool ConnectedOnSide(int c, int r, Piece.sides side)
 {
     return board[c, r].ConnectedOnSide(side);
 }
Exemplo n.º 4
0
 public void AddFallingPiece(int c, int r, Piece.pieceTypes type, int vertOffset)
 {
     fallingPieces[c.ToString() + "_" + r.ToString()] = new FallingPiece(type, vertOffset);
 }
Exemplo n.º 5
0
 public void AddRotatingPiece(int c, int r, Piece.pieceTypes type, bool clkwise)
 {
     rotatingPieces[c.ToString() + "_" + r.ToString()] = new RotatingPiece(type, clkwise);
 }
Exemplo n.º 6
0
 public void AddFadingPiece(int c, int r, Piece.pieceTypes type)
 {
     fadingPieces[c.ToString() + "_" + r.ToString()] = new FadingPiece(type, true);
 }
Exemplo n.º 7
0
 public void SetPieceType(int c, int r, Piece.pieceTypes type)
 {
     board[c, r].SetPiece(type);
 }
Exemplo 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;
                        }
                    }
                }
            }
        }
Exemplo n.º 9
0
 public RotatingPiece(Piece.pieceTypes pieceType, bool clkwise)
     : base(pieceType)
 {
     this.clkwise = clkwise;
 }
Exemplo n.º 10
0
 public FallingPiece(Piece.pieceTypes pieceType, int vertOffset)
     : base(pieceType)
 {
     this.vertOffset = vertOffset;
 }