Class AttributeMap
java.lang.Object
java.util.AbstractMap<K,V>
java.util.EnumMap<K,V>
net.demilich.metastone.game.cards.BaseMap<Attribute,Object>
net.demilich.metastone.game.cards.AttributeMap
- All Implemented Interfaces:
Serializable
,Cloneable
,Map<Attribute,
,Object> HasEntrySet<Attribute,
Object>
- Direct Known Subclasses:
CardAttributeMap
public class AttributeMap
extends BaseMap<Attribute,Object>
implements Serializable, Cloneable, HasEntrySet<Attribute,Object>
An attribute map is a
Map
that contains Attribute
as keys and Object
(typically integers and
booleans) as values. For example, the attributes of a minion that has "Divine Shield. Spell Damage +1" looks like:
{ "DIVINE_SHIELD": true, "SPELL_DAMAGE": 1 }Observe that the key names are capitalized and have underscores, exactly like they appear in
Attribute
.
Attributes should store whatever is meant to be persisted throughout the game. They can be affected by spells like
AddAttributeSpell
and RemoveAttributeSpell
;
they are modified en-mass by SilenceSpell
. Some attributes, like Attribute.MANA_COST_MODIFIER
, contain not an integer or boolean but a proper object, like a ValueProvider
in this case.
-
Nested Class Summary
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,
V>, AbstractMap.SimpleImmutableEntry<K, V> Nested classes/interfaces inherited from interface net.demilich.metastone.game.cards.desc.HasEntrySet
HasEntrySet.BfsEnum, HasEntrySet.BfsNode<T extends Enum,
V> -
Constructor Summary
-
Method Summary
Methods inherited from class java.util.EnumMap
clear, containsKey, containsValue, equals, get, hashCode, keySet, putAll, remove, size, values
Methods inherited from class java.util.AbstractMap
isEmpty
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface net.demilich.metastone.game.cards.desc.HasEntrySet
bfs
Methods inherited from interface java.util.Map
compute, computeIfAbsent, computeIfPresent, forEach, getOrDefault, merge, putIfAbsent, remove, replace, replace, replaceAll
-
Constructor Details
-
AttributeMap
public AttributeMap() -
AttributeMap
-
-
Method Details
-
clone
-
put
-
unsafeKeySet
-
entrySet
-