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