public class ModifiableAttributeInstance extends java.lang.Object implements IAttributeInstance
Modifier and Type | Field and Description |
---|---|
private AbstractAttributeMap |
attributeMap |
private double |
baseValue |
private double |
cachedValue |
private IAttribute |
genericAttribute |
private java.util.Map<java.lang.String,java.util.Set<AttributeModifier>> |
mapByName |
private java.util.Map<java.lang.Integer,java.util.Set<AttributeModifier>> |
mapByOperation |
private java.util.Map<java.util.UUID,AttributeModifier> |
mapByUUID |
private boolean |
needsUpdate |
Constructor and Description |
---|
ModifiableAttributeInstance(AbstractAttributeMap attributeMapIn,
IAttribute genericAttributeIn) |
Modifier and Type | Method and Description |
---|---|
void |
applyModifier(AttributeModifier modifier) |
private double |
computeValue() |
protected void |
flagForUpdate() |
private java.util.Collection<AttributeModifier> |
getAppliedModifiers(int operation) |
IAttribute |
getAttribute() |
double |
getAttributeValue() |
double |
getBaseValue() |
AttributeModifier |
getModifier(java.util.UUID uuid) |
java.util.Collection<AttributeModifier> |
getModifiers() |
java.util.Collection<AttributeModifier> |
getModifiersByOperation(int operation) |
boolean |
hasModifier(AttributeModifier modifier) |
void |
removeAllModifiers() |
void |
removeModifier(AttributeModifier modifier) |
void |
removeModifier(java.util.UUID p_188479_1_) |
void |
setBaseValue(double baseValue) |
private final AbstractAttributeMap attributeMap
private final IAttribute genericAttribute
private final java.util.Map<java.lang.Integer,java.util.Set<AttributeModifier>> mapByOperation
private final java.util.Map<java.lang.String,java.util.Set<AttributeModifier>> mapByName
private final java.util.Map<java.util.UUID,AttributeModifier> mapByUUID
private double baseValue
private boolean needsUpdate
private double cachedValue
public ModifiableAttributeInstance(AbstractAttributeMap attributeMapIn, IAttribute genericAttributeIn)
public IAttribute getAttribute()
getAttribute
in interface IAttributeInstance
public double getBaseValue()
getBaseValue
in interface IAttributeInstance
public void setBaseValue(double baseValue)
setBaseValue
in interface IAttributeInstance
public java.util.Collection<AttributeModifier> getModifiersByOperation(int operation)
getModifiersByOperation
in interface IAttributeInstance
public java.util.Collection<AttributeModifier> getModifiers()
getModifiers
in interface IAttributeInstance
@Nullable public AttributeModifier getModifier(java.util.UUID uuid)
getModifier
in interface IAttributeInstance
public boolean hasModifier(AttributeModifier modifier)
hasModifier
in interface IAttributeInstance
public void applyModifier(AttributeModifier modifier)
applyModifier
in interface IAttributeInstance
protected void flagForUpdate()
public void removeModifier(AttributeModifier modifier)
removeModifier
in interface IAttributeInstance
public void removeModifier(java.util.UUID p_188479_1_)
removeModifier
in interface IAttributeInstance
public void removeAllModifiers()
removeAllModifiers
in interface IAttributeInstance
public double getAttributeValue()
getAttributeValue
in interface IAttributeInstance
private double computeValue()
private java.util.Collection<AttributeModifier> getAppliedModifiers(int operation)