New method to see if a jail has an empty cell
This commit is contained in:
parent
82487805b4
commit
68e35ed271
@ -224,6 +224,15 @@ public class Jail {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Checks if there is an empty cell in this Jail. */
|
||||||
|
public boolean hasEmptyCell() {
|
||||||
|
for(Cell c : getCells())
|
||||||
|
if(!c.hasPrisoner())
|
||||||
|
return true;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
/** Gets the amount of cells the jail. */
|
/** Gets the amount of cells the jail. */
|
||||||
public int getCellCount() {
|
public int getCellCount() {
|
||||||
return this.cells.size();
|
return this.cells.size();
|
||||||
|
Loading…
Reference in New Issue
Block a user