public class Variant
extends java.lang.Object
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/markersetsModifier and Type | Class and Description |
---|---|
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.
|
Modifier and Type | Field and Description |
---|---|
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 and Description |
---|
Variant(IVariantInitializer variantInitializer,
AllCreatureType creatureTypes,
MasterBoard masterBoard,
javax.swing.text.Document readme,
java.lang.String name) |
Modifier and Type | Method and Description |
---|---|
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.
|
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
public Variant(IVariantInitializer variantInitializer, AllCreatureType creatureTypes, MasterBoard masterBoard, javax.swing.text.Document readme, java.lang.String name)
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()