//-- Creating a goal piece (with or without a house on it-- put zero for no house/person) // at a particular place on the edge of the board. public int createGoalPiece(int houseNumber, int personNumber, Coordinates c) { int p = Pieces.createGreenGrassPiece(); p = Pieces.setHouseNumber(p, houseNumber); p = Pieces.setPersonNumber(p, personNumber); p = this.setGoalDirections(p, c); return(p); }
public WoodsyBoardData() { // board constructor: board starts out empty. this.board = new int[8, 8]; // rows first, then columns. . this.height = 8; this.width = 8; // note: the edges have Green Grass pieces, showing where the people and houses go. for (int i = 0; i < this.height; i++) { for (int j = 0; j < this.width; j++) { if (i == 0 || j == 0 || i + 1 == this.height || j + 1 == this.width) { this.board[i, j] = Pieces.createGreenGrassPiece(); } else { this.board[i, j] = Pieces.createBlankPiece(); } } } }
public static bool isGreenGrassPiece(int p) { return(p == Pieces.createGreenGrassPiece()); }