Skip to content

Class endstone::AttributeInstance

ClassList > endstone > AttributeInstance

Represents a mutable instance of an attribute and its associated modifiers and values.

  • #include <endstone/attribute/attribute_instance.h>

Public Functions

Type Name
virtual void addModifier (const AttributeModifier & modifier) = 0
Add a modifier to this instance.
virtual float getBaseMaxValue () const = 0
Base max value of this instance before modifiers are applied.
virtual float getBaseMinValue () const = 0
Base min value of this instance before modifiers are applied.
virtual float getBaseValue () const = 0
Base value of this instance before modifiers are applied.
virtual float getMaxValue () const = 0
Get the max value of this instance after all associated modifiers have been applied.
virtual float getMinValue () const = 0
Get the min value of this instance after all associated modifiers have been applied.
virtual std::vector< AttributeModifier > getModifiers () const = 0
Get all modifiers present on this instance.
virtual std::string getType () const = 0
The attribute type pertaining to this instance.
virtual float getValue () const = 0
Get the value of this instance after all associated modifiers have been applied.
virtual void removeModifier (const AttributeModifier & modifier) = 0
Remove a modifier from this instance.
virtual void setBaseMaxValue (float value) = 0
Set the base max value of this instance.
virtual void setBaseMinValue (float value) = 0
Set the base min value of this instance.
virtual void setBaseValue (float value) = 0
Set the base value of this instance.
virtual ~AttributeInstance () = default

Public Functions Documentation

function addModifier

Add a modifier to this instance.

virtual void endstone::AttributeInstance::addModifier (
    const  AttributeModifier & modifier
) = 0

Parameters:

  • modifier to add

function getBaseMaxValue

Base max value of this instance before modifiers are applied.

virtual float endstone::AttributeInstance::getBaseMaxValue () const = 0

Returns:

base max value


function getBaseMinValue

Base min value of this instance before modifiers are applied.

virtual float endstone::AttributeInstance::getBaseMinValue () const = 0

Returns:

base max value


function getBaseValue

Base value of this instance before modifiers are applied.

virtual float endstone::AttributeInstance::getBaseValue () const = 0

Returns:

base value


function getMaxValue

Get the max value of this instance after all associated modifiers have been applied.

virtual float endstone::AttributeInstance::getMaxValue () const = 0

Returns:

the max attribute value


function getMinValue

Get the min value of this instance after all associated modifiers have been applied.

virtual float endstone::AttributeInstance::getMinValue () const = 0

Returns:

the min attribute value


function getModifiers

Get all modifiers present on this instance.

virtual std::vector< AttributeModifier > endstone::AttributeInstance::getModifiers () const = 0

Returns:

a copied collection of all modifiers


function getType

The attribute type pertaining to this instance.

virtual std::string endstone::AttributeInstance::getType () const = 0

Returns:

the attribute type


function getValue

Get the value of this instance after all associated modifiers have been applied.

virtual float endstone::AttributeInstance::getValue () const = 0

Returns:

the total attribute value


function removeModifier

Remove a modifier from this instance.

virtual void endstone::AttributeInstance::removeModifier (
    const  AttributeModifier & modifier
) = 0

Parameters:

  • modifier to remove

function setBaseMaxValue

Set the base max value of this instance.

virtual void endstone::AttributeInstance::setBaseMaxValue (
    float value
) = 0

Parameters:

  • value new base max value

function setBaseMinValue

Set the base min value of this instance.

virtual void endstone::AttributeInstance::setBaseMinValue (
    float value
) = 0

Parameters:

  • value new base min value

function setBaseValue

Set the base value of this instance.

virtual void endstone::AttributeInstance::setBaseValue (
    float value
) = 0

Parameters:

  • value new base value

function ~AttributeInstance

virtual endstone::AttributeInstance::~AttributeInstance () = default


The documentation for this class was generated from the following file include/endstone/attribute/attribute_instance.h