Class 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.

See Also: