Class AttributeMap

java.lang.Object
java.util.AbstractMap<K,​V>
java.util.EnumMap<K,​V>
net.demilich.metastone.game.cards.BaseMap<Attribute,​java.lang.Object>
net.demilich.metastone.game.cards.AttributeMap
All Implemented Interfaces:
java.io.Serializable, java.lang.Cloneable, java.util.Map<Attribute,​java.lang.Object>, HasEntrySet<Attribute,​java.lang.Object>
Direct Known Subclasses:
CardAttributeMap

public class AttributeMap
extends BaseMap<Attribute,​java.lang.Object>
implements java.io.Serializable, java.lang.Cloneable, HasEntrySet<Attribute,​java.lang.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:
for more about valid attributes here., Serialized Form
  • Nested Class Summary

    Nested classes/interfaces inherited from class java.util.AbstractMap

    java.util.AbstractMap.SimpleEntry<K extends java.lang.Object,​V extends java.lang.Object>, java.util.AbstractMap.SimpleImmutableEntry<K extends java.lang.Object,​V extends java.lang.Object>

    Nested classes/interfaces inherited from interface net.demilich.metastone.game.cards.desc.HasEntrySet

    HasEntrySet.BfsEnum, HasEntrySet.BfsNode<T extends java.lang.Enum,​V>

    Nested classes/interfaces inherited from interface java.util.Map

    java.util.Map.Entry<K extends java.lang.Object,​V extends java.lang.Object>
  • Constructor Summary

    Constructors 
    Constructor Description
    AttributeMap()  
    AttributeMap​(java.util.Map<Attribute,​java.lang.Object> attributes)  
  • Method Summary

    Modifier and Type Method Description
    AttributeMap clone()  
    java.util.Set<java.util.Map.Entry<Attribute,​java.lang.Object>> entrySet()  
    java.lang.Object put​(@NotNull Attribute key, java.lang.Object value)  
    java.util.Set<Attribute> unsafeKeySet()  

    Methods inherited from class net.demilich.metastone.game.cards.BaseMap

    toString

    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