Skip to content

Commit

Permalink
Rename board to mainBoard
Browse files Browse the repository at this point in the history
  • Loading branch information
adamgraham committed Aug 12, 2021
1 parent 3db34ea commit 18976e3
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
2 changes: 1 addition & 1 deletion Assets/Scenes/Tetris.unity
Original file line number Diff line number Diff line change
Expand Up @@ -603,7 +603,7 @@ MonoBehaviour:
m_Name:
m_EditorClassIdentifier:
tile: {fileID: 11400000, guid: a10927dec698b7c49b1375f89e8db4d2, type: 2}
board: {fileID: 1887623656}
mainBoard: {fileID: 1887623656}
trackingPiece: {fileID: 1887623655}
--- !u!1 &1887623652
GameObject:
Expand Down
10 changes: 5 additions & 5 deletions Assets/Scripts/Ghost.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
public class Ghost : MonoBehaviour
{
public Tile tile;
public Board board;
public Board mainBoard;
public Piece trackingPiece;

public Tilemap tilemap { get; private set; }
Expand Down Expand Up @@ -46,22 +46,22 @@ private void Drop()
Vector3Int position = this.trackingPiece.position;

int current = position.y;
int bottom = -this.board.boardSize.y / 2 - 1;
int bottom = -this.mainBoard.boardSize.y / 2 - 1;

this.board.Clear(this.trackingPiece);
this.mainBoard.Clear(this.trackingPiece);

for (int row = current; row >= bottom; row--)
{
position.y = row;

if (this.board.IsValidPosition(this.trackingPiece, position)) {
if (this.mainBoard.IsValidPosition(this.trackingPiece, position)) {
this.position = position;
} else {
break;
}
}

this.board.Set(this.trackingPiece);
this.mainBoard.Set(this.trackingPiece);
}

private void Set()
Expand Down

0 comments on commit 18976e3

Please sign in to comment.