-
Notifications
You must be signed in to change notification settings - Fork 92
Expand file tree
/
Copy pathGridRegion.java
More file actions
53 lines (43 loc) · 1.03 KB
/
GridRegion.java
File metadata and controls
53 lines (43 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
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(){}
*/
}