Skip to content

Commit

Permalink
Merge branch 'dev' into thermometer
Browse files Browse the repository at this point in the history
  • Loading branch information
charlestian23 authored Apr 16, 2024
2 parents 0d36dac + e7ea944 commit fe7f2f8
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,9 @@ public int columnStars(int columnIndex) {
int stars = 0;
if (columnIndex < size) {
for (StarBattleCell c: this.getCol(columnIndex)) {
if (c.getType() == StarBattleCellType.STAR)
if (c.getType() == StarBattleCellType.STAR) {
++stars;
}
}
}
return stars;
Expand All @@ -84,8 +85,9 @@ public int rowStars(int rowIndex) {
int stars = 0;
if (rowIndex < size) {
for (StarBattleCell c: this.getRow(rowIndex)) {
if (c.getType() == StarBattleCellType.STAR)
if (c.getType() == StarBattleCellType.STAR) {
++stars;
}
}
}
return stars;
Expand All @@ -97,8 +99,9 @@ public StarBattleBoard copy() {
for (int y = 0; y < this.dimension.height; y++) {
copy.setCell(x, y, getCell(x, y).copy());
}
if (x < this.regions.size())
if (x < this.regions.size()) {
copy.regions.add(this.getRegion(x).copy());
}
}
for (PuzzleElement e : modifiedData) {
copy.getPuzzleElement(e).setModifiable(false);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,9 @@ public StarBattleRegion copy() {
public int numStars() {
int stars = 0;
for (StarBattleCell c: regionCells) {
if (c.getType() == StarBattleCellType.STAR)
if (c.getType() == StarBattleCellType.STAR) {
++stars;
}
}
return stars;
}
Expand Down

0 comments on commit fe7f2f8

Please sign in to comment.