|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectnet.sf.freecol.common.model.FeatureContainer
public class FeatureContainer
| Field Summary | |
|---|---|
private java.util.Map<java.lang.String,java.util.Set<Ability>> |
abilities
|
private static java.util.logging.Logger |
logger
|
private java.util.Map<java.lang.String,java.util.Set<Modifier>> |
modifiers
|
| Constructor Summary | |
|---|---|
FeatureContainer()
|
|
| Method Summary | |
|---|---|
void |
add(FeatureContainer featureContainer)
Describe add method here. |
boolean |
addAbility(Ability ability)
Add the given Ability to the set of Abilities present. |
boolean |
addModifier(Modifier modifier)
Add the given Modifier to the set of Modifiers present. |
float |
applyModifier(float number,
java.lang.String id)
Applies a Set of Modifiers with the given ID to the given float value. |
float |
applyModifier(float number,
java.lang.String id,
FreeColGameObjectType objectType)
Applies a Set of Modifiers with the given ID which match the given FreeColGameObjectType to the given float value. |
float |
applyModifier(float number,
java.lang.String id,
FreeColGameObjectType objectType,
Turn turn)
Applies a Set of Modifiers with the given ID which match the given FreeColGameObjectType and Turn to the given float value. |
static float |
applyModifiers(float number,
Turn turn,
java.util.List<Modifier> modifierSet)
Applies a given Set of Modifiers to the given float value. |
static float |
applyModifierSet(float number,
Turn turn,
java.util.Set<Modifier> modifierSet)
Applies a given Set of Modifiers to the given float value. |
boolean |
containsAbilityKey(java.lang.String key)
|
boolean |
containsModifierKey(java.lang.String key)
|
java.util.Set<Ability> |
getAbilities()
|
java.util.Set<Ability> |
getAbilitySet(java.lang.String id)
Returns a Set of Abilities with the given ID. |
java.util.Set<Ability> |
getAbilitySet(java.lang.String id,
FreeColGameObjectType objectType)
Returns a Set of Abilities with the given ID which apply to the given FreeColGameObjectType. |
java.util.Set<Ability> |
getAbilitySet(java.lang.String id,
FreeColGameObjectType objectType,
Turn turn)
Returns a Set of Abilities with the given ID which apply to the given FreeColGameObjectType and Turn. |
java.util.Set<Modifier> |
getModifiers()
|
java.util.Set<Modifier> |
getModifierSet(java.lang.String id)
Returns a Set of Abilities with the given ID. |
java.util.Set<Modifier> |
getModifierSet(java.lang.String id,
FreeColGameObjectType objectType)
Returns a Set of Abilities with the given ID which apply to the given FreeColGameObjectType. |
java.util.Set<Modifier> |
getModifierSet(java.lang.String id,
FreeColGameObjectType objectType,
Turn turn)
Returns a Set of Abilities with the given ID which apply to the given FreeColGameObjectType and Turn. |
static boolean |
hasAbility(java.util.Set<Ability> abilitySet)
Returns true if the given Set of Abilities is not empty and does not contain any Abilities with the value false. |
boolean |
hasAbility(java.lang.String id)
Returns true if this Player has the ability with the given ID. |
boolean |
hasAbility(java.lang.String id,
FreeColGameObjectType objectType)
Returns true if this Player has the ability with the given ID. |
boolean |
hasAbility(java.lang.String id,
FreeColGameObjectType objectType,
Turn turn)
Returns true if this Player has the ability with the given ID. |
void |
remove(FeatureContainer featureContainer)
Describe remove method here. |
void |
removeAbilities(java.lang.String id)
Describe removeAbilities method here. |
Ability |
removeAbility(Ability oldAbility)
Removes and returns a Ability from this ability set. |
Modifier |
removeModifier(Modifier oldModifier)
Removes and returns a Modifier from this modifier set. |
void |
removeModifiers(java.lang.String id)
Describe removeModifiers method here. |
void |
replaceSource(FreeColGameObjectType oldSource,
FreeColGameObjectType newSource)
Replaces the source field. |
java.lang.String |
toString()
Debug helper. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
private static final java.util.logging.Logger logger
private java.util.Map<java.lang.String,java.util.Set<Ability>> abilities
private java.util.Map<java.lang.String,java.util.Set<Modifier>> modifiers
| Constructor Detail |
|---|
public FeatureContainer()
| Method Detail |
|---|
public java.util.Set<Ability> getAbilities()
public java.util.Set<Modifier> getModifiers()
public java.util.Set<Ability> getAbilitySet(java.lang.String id)
id - a String value
Set value
public java.util.Set<Ability> getAbilitySet(java.lang.String id,
FreeColGameObjectType objectType)
id - a String valueobjectType - a FreeColGameObjectType value
Set value
public java.util.Set<Ability> getAbilitySet(java.lang.String id,
FreeColGameObjectType objectType,
Turn turn)
id - a String valueobjectType - a FreeColGameObjectType valueturn - a Turn value
Set valuepublic boolean hasAbility(java.lang.String id)
id - a String value
boolean value
public boolean hasAbility(java.lang.String id,
FreeColGameObjectType objectType)
id - a String valueobjectType - a FreeColGameObjectType value
boolean value
public boolean hasAbility(java.lang.String id,
FreeColGameObjectType objectType,
Turn turn)
id - a String valueobjectType - a FreeColGameObjectType valueturn - a Turn value
boolean valuepublic static boolean hasAbility(java.util.Set<Ability> abilitySet)
boolean valuepublic java.util.Set<Modifier> getModifierSet(java.lang.String id)
id - a String value
Set value
public java.util.Set<Modifier> getModifierSet(java.lang.String id,
FreeColGameObjectType objectType)
id - a String valueobjectType - a FreeColGameObjectType value
Set value
public java.util.Set<Modifier> getModifierSet(java.lang.String id,
FreeColGameObjectType objectType,
Turn turn)
id - a String valueobjectType - a FreeColGameObjectType valueturn - a Turn value
Set value
public float applyModifier(float number,
java.lang.String id)
number - a float valueid - a String value
public float applyModifier(float number,
java.lang.String id,
FreeColGameObjectType objectType)
number - a float valueid - a String valueobjectType - a FreeColGameObjectType value
public float applyModifier(float number,
java.lang.String id,
FreeColGameObjectType objectType,
Turn turn)
number - a float valueid - a String valueobjectType - a FreeColGameObjectType valueturn - a Turn value
public static float applyModifiers(float number,
Turn turn,
java.util.List<Modifier> modifierSet)
number - a float valueturn - a Turn value
float value
public static float applyModifierSet(float number,
Turn turn,
java.util.Set<Modifier> modifierSet)
number - a float valueturn - a Turn value
float valuepublic boolean addAbility(Ability ability)
ability - a Ability value
public boolean addModifier(Modifier modifier)
modifier - a Modifier value
public Ability removeAbility(Ability oldAbility)
oldAbility - a Ability value
Ability valuepublic void removeAbilities(java.lang.String id)
removeAbilities method here.
id - a String valuepublic Modifier removeModifier(Modifier oldModifier)
oldModifier - a Modifier value
Modifier valuepublic void removeModifiers(java.lang.String id)
removeModifiers method here.
id - a String valuepublic void add(FeatureContainer featureContainer)
add method here.
featureContainer - a FeatureContainer valuepublic void remove(FeatureContainer featureContainer)
remove method here.
featureContainer - a FeatureContainer valuepublic boolean containsAbilityKey(java.lang.String key)
public boolean containsModifierKey(java.lang.String key)
public void replaceSource(FreeColGameObjectType oldSource,
FreeColGameObjectType newSource)
oldSource - a FreeColGameObjectType valuenewSource - a FreeColGameObjectType valuepublic java.lang.String toString()
toString in class java.lang.Object
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||