-
Notifications
You must be signed in to change notification settings - Fork 82
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'improve-auto-formatter' of https://github.com/charlesti…
…an23/LEGUP into improve-auto-formatter
- Loading branch information
Showing
1 changed file
with
55 additions
and
53 deletions.
There are no files selected for viewing
108 changes: 55 additions & 53 deletions
108
src/main/java/edu/rpi/legup/model/gameboard/GridRegion.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,53 +1,55 @@ | ||
package edu.rpi.legup.model.gameboard; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public abstract class GridRegion<T> { | ||
|
||
protected List<T> regionCells; | ||
|
||
/** | ||
* Region Constructor | ||
*/ | ||
public GridRegion() { | ||
this.regionCells = new ArrayList<>(); | ||
} | ||
|
||
/** | ||
* Adds the cell to the region | ||
* @param cell cell to be added to the region | ||
*/ | ||
public void addCell(T cell) { | ||
regionCells.add(cell); | ||
} | ||
|
||
/** | ||
* Removes the cell from the region | ||
* @param cell cell to be remove from the region | ||
*/ | ||
public void removeCell(T cell) { | ||
regionCells.remove(cell); | ||
} | ||
|
||
/** | ||
* Returns the list of cells in the region | ||
* @return list of cells in region | ||
*/ | ||
public List<T> getCells() { | ||
return regionCells; | ||
} | ||
|
||
/** | ||
* Returns the number of cells in the region | ||
* @return number of cells in the region | ||
*/ | ||
public int getSize(){ | ||
return regionCells.size(); | ||
} | ||
|
||
/* | ||
public void colorRegion(){} | ||
*/ | ||
|
||
} | ||
package edu.rpi.legup.model.gameboard; | ||
|
||
import java.util.ArrayList; | ||
import java.util.List; | ||
|
||
public abstract class GridRegion<T> { | ||
|
||
protected List<T> regionCells; | ||
|
||
/** Region Constructor */ | ||
public GridRegion() { | ||
this.regionCells = new ArrayList<>(); | ||
} | ||
|
||
/** | ||
* Adds the cell to the region | ||
* | ||
* @param cell cell to be added to the region | ||
*/ | ||
public void addCell(T cell) { | ||
regionCells.add(cell); | ||
} | ||
|
||
/** | ||
* Removes the cell from the region | ||
* | ||
* @param cell cell to be remove from the region | ||
*/ | ||
public void removeCell(T cell) { | ||
regionCells.remove(cell); | ||
} | ||
|
||
/** | ||
* Returns the list of cells in the region | ||
* | ||
* @return list of cells in region | ||
*/ | ||
public List<T> getCells() { | ||
return regionCells; | ||
} | ||
|
||
/** | ||
* Returns the number of cells in the region | ||
* | ||
* @return number of cells in the region | ||
*/ | ||
public int getSize() { | ||
return regionCells.size(); | ||
} | ||
|
||
/* | ||
public void colorRegion(){} | ||
*/ | ||
|
||
} |