|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.empireclassic.Remote.SelectionMap
public class SelectionMap
Many commands provide the user a way to restrict the selection of sectors
based on various criteria. The SelectionMap
is simply a
structure that holds a boolean value for each possible sector. On creation
all are set to false (thus, none selected).
Usually the user input will be parsed for selection criteria, which will then be used to set only particular values in this map.
The command will then use this map as the basis for selecting which sectors will finally be operated upon.
Criteria
Constructor Summary | |
---|---|
SelectionMap(IslandInfo island)
Initialize a new SelectionMap to all false values. |
Method Summary | |
---|---|
void |
clearSelection(IslandCoord coord)
Clear selection of one sector |
int |
count()
Return the number of selected coords |
int |
count(SelectionCondition condition)
Return number of selected coords that meet a certain condition and are selected. |
boolean |
isSelected(IslandCoord coord)
Check if a specific location has been selected (true/false). |
void |
setSelection(Criteria criteria)
Use a Criteria structure to set a bunch of sectors
to selected. |
void |
setSelection(IslandCoord coord)
Set one sector to be selected. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SelectionMap(IslandInfo island)
SelectionMap
to all false values.
island
- Used to get the necessary size for this map.Method Detail |
---|
public boolean isSelected(IslandCoord coord)
coord
- The location to check
public void setSelection(Criteria criteria)
Criteria
structure to set a bunch of sectors
to selected.
criteria
- A previously filled out Criteria
structure.Criteria
public void setSelection(IslandCoord coord)
coord
- The sector to be marked as selected.public void clearSelection(IslandCoord coord)
coord
- The sector to be marked as unselectedpublic int count()
public int count(SelectionCondition condition)
condition
- The condition to check
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |