|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.colossus.variant.Variant
public class Variant
Hub for all variant-specific information.
This class is meant to give access to all the information about a Colossus
game in the static sense: the master board layout, the battle board layouts,
available creatures, rules, etc. The information about a game in progress is
in the Game
class.
Instances of this class are immutable.
TODO add access to the markers by having a class for them
TODO same thing for the colors/markersets
Nested Class Summary | |
---|---|
static class |
Variant.AcquirableData
Used internally to record the Acquirable name, points needed for recruiting, and the list of terrains in which the Acquirable dwells. |
Field Summary | |
---|---|
private java.util.List<Variant.AcquirableData> |
acquirableList
|
private java.util.Map<java.lang.String,CreatureType> |
creatureTypeByNameCache
A map for fast lookup of creatures by their name. |
private AllCreatureType |
creatureTypes
|
private static java.util.logging.Logger |
LOGGER
|
private MasterBoard |
masterBoard
|
private javax.swing.text.Document |
readme
|
private java.util.List<CreatureType> |
summonableCreatureTypes
|
private java.util.Collection<MasterBoardTerrain> |
terrains
|
private int |
titanImprove
|
private int |
titanTeleport
|
private java.lang.String |
variantName
|
Constructor Summary | |
---|---|
Variant(IVariantInitializer variantInitializer,
AllCreatureType creatureTypes,
MasterBoard masterBoard,
javax.swing.text.Document readme,
java.lang.String name)
|
Method Summary | |
---|---|
java.util.List<java.lang.String> |
getAcquirableList()
To obtain all the Creature that can be Acquired. |
int |
getAcquirableRecruitmentsValue()
To obtain the base amount of points needed for Acquirement. |
CreatureType |
getCreatureByName(java.lang.String name)
Look up a creature type by its name. |
java.util.SortedSet<CreatureType> |
getCreatureTypes()
|
java.util.List<CreatureType> |
getCreatureTypesAsList()
|
MasterBoard |
getMasterBoard()
|
int |
getMaxBattleTurns()
|
java.lang.String |
getName()
|
java.lang.String |
getPrimaryAcquirable()
To obtain the first Acquirable (aka 'primary') Creature name. |
javax.swing.text.Document |
getReadme()
|
java.util.List<java.lang.String> |
getRecruitableAcquirableList(MasterBoardTerrain t,
int value)
To obtain all the Creature that can be acquired at the given amount of points in the given terrain. |
int[] |
getReinforcementTurns()
|
java.util.List<CreatureType> |
getSummonableCreatureTypes()
|
MasterBoardTerrain |
getTerrainById(java.lang.String id)
Retrieves the terrain with the given identifier. |
java.util.Collection<MasterBoardTerrain> |
getTerrains()
|
int |
getTitanImprovementValue()
To obtain the base amount of points needed for Titan improvement. |
int |
getTitanTeleportValue()
To obtain the amount of points needed for Titan teleport. |
private void |
initCreatureNameCache()
|
boolean |
isAcquirable(CreatureType c)
Check if the Creature in parameter is an Acquirable creature or not. |
private boolean |
isAcquirable(java.lang.String name)
Check if the Creature whose name is in parameter is an Acquirable creature or not. |
boolean |
isCreature(java.lang.String name)
Checks if a creature with the given name exists. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
private static final java.util.logging.Logger LOGGER
private final AllCreatureType creatureTypes
private final java.util.List<CreatureType> summonableCreatureTypes
private final java.util.Collection<MasterBoardTerrain> terrains
private final java.util.List<Variant.AcquirableData> acquirableList
private final MasterBoard masterBoard
private final javax.swing.text.Document readme
private final java.lang.String variantName
private final int titanImprove
private final int titanTeleport
private final java.util.Map<java.lang.String,CreatureType> creatureTypeByNameCache
Constructor Detail |
---|
public Variant(IVariantInitializer variantInitializer, AllCreatureType creatureTypes, MasterBoard masterBoard, javax.swing.text.Document readme, java.lang.String name)
Method Detail |
---|
public java.util.List<CreatureType> getCreatureTypesAsList()
public java.util.SortedSet<CreatureType> getCreatureTypes()
public java.util.Collection<MasterBoardTerrain> getTerrains()
public MasterBoardTerrain getTerrainById(java.lang.String id)
id
- The identifier for the terrain. Must be a valid for this variant.
java.lang.IllegalArgumentException
- iff the identifier does not refer to an
existing terrain in this variant.public MasterBoard getMasterBoard()
public javax.swing.text.Document getReadme()
public java.lang.String getName()
public CreatureType getCreatureByName(java.lang.String name)
name
- Name of a creature type. Not null.
private void initCreatureNameCache()
public boolean isCreature(java.lang.String name)
name
- (case insensitive) name of a creature, must not be null.
public java.util.List<CreatureType> getSummonableCreatureTypes()
public java.util.List<java.lang.String> getAcquirableList()
public int getAcquirableRecruitmentsValue()
public java.lang.String getPrimaryAcquirable()
public java.util.List<java.lang.String> getRecruitableAcquirableList(MasterBoardTerrain t, int value)
t
- The Terrain in which the recruitment occurs.value
- The number of points at which the recruitment occurs.
Valid values are constrained.
getAcquirableRecruitmentsValue()
private boolean isAcquirable(java.lang.String name)
name
- The name of the Creature inquired.
public boolean isAcquirable(CreatureType c)
c
- The Creature inquired.
public int getTitanImprovementValue()
public int getTitanTeleportValue()
public int[] getReinforcementTurns()
public int getMaxBattleTurns()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |