|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectgames.strategy.engine.data.GameDataComponent
games.strategy.engine.data.UnitCollection
public class UnitCollection
| Constructor Summary | |
|---|---|
UnitCollection(NamedUnitHolder holder,
GameData data)
Creates new UnitCollection |
|
| Method Summary | |
|---|---|
boolean |
allMatch(Match<Unit> matcher)
|
boolean |
containsAll(java.util.Collection<Unit> units)
|
int |
countMatches(Match<Unit> predicate)
|
NamedUnitHolder |
getHolder()
|
java.util.List<Unit> |
getMatches(Match<Unit> predicate)
|
java.util.Set<PlayerID> |
getPlayersWithUnits()
|
IntegerMap<PlayerID> |
getPlayerUnitCounts()
|
int |
getUnitCount()
|
int |
getUnitCount(PlayerID owner)
|
int |
getUnitCount(UnitType type)
|
int |
getUnitCount(UnitType type,
PlayerID owner)
|
java.util.Collection<Unit> |
getUnits()
|
java.util.Collection<Unit> |
getUnits(IntegerMap<UnitType> types)
Passed a map of UnitType -> int return a collection of units of each type up to max |
java.util.Collection<Unit> |
getUnits(UnitType type,
int count)
returns up to int units of a given type currently in the collection. |
IntegerMap<UnitType> |
getUnitsByType()
Returns a map of UnitType -> int. |
IntegerMap<UnitType> |
getUnitsByType(PlayerID id)
Returns a map of UnitType -> int. |
boolean |
hasUnitsFromMultiplePlayers()
|
boolean |
isEmpty()
|
java.util.Iterator<Unit> |
iterator()
|
int |
size()
|
boolean |
someMatch(Match<Unit> matcher)
|
java.lang.String |
toString()
|
| Methods inherited from class games.strategy.engine.data.GameDataComponent |
|---|
getData, readInternal, writeInternal |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public UnitCollection(NamedUnitHolder holder,
GameData data)
| Method Detail |
|---|
public int getUnitCount()
public int getUnitCount(UnitType type)
public int getUnitCount(UnitType type,
PlayerID owner)
public int getUnitCount(PlayerID owner)
public boolean containsAll(java.util.Collection<Unit> units)
public java.util.Collection<Unit> getUnits(UnitType type,
int count)
public IntegerMap<UnitType> getUnitsByType()
public IntegerMap<UnitType> getUnitsByType(PlayerID id)
public java.util.Collection<Unit> getUnits(IntegerMap<UnitType> types)
public int size()
public boolean isEmpty()
public java.util.Collection<Unit> getUnits()
public java.util.Set<PlayerID> getPlayersWithUnits()
public IntegerMap<PlayerID> getPlayerUnitCounts()
public boolean hasUnitsFromMultiplePlayers()
public NamedUnitHolder getHolder()
public boolean allMatch(Match<Unit> matcher)
public boolean someMatch(Match<Unit> matcher)
public int countMatches(Match<Unit> predicate)
public java.util.List<Unit> getMatches(Match<Unit> predicate)
public java.lang.String toString()
toString in class java.lang.Objectpublic java.util.Iterator<Unit> iterator()
iterator in interface java.lang.Iterable<Unit>
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||