Struct StatValue
This struct standardizes how stat values are serialized.
Implements
Namespace: UnityEngine .GameFoundation
Assembly: solution.dll
Syntax
[Serializable]
public struct StatValue : IDictionaryConvertible
Remarks
For fields that share the same memory space, only the bigger type will be serialized to avoid conflicting serialization and minimize the serialization size.
Properties
Name | Description |
---|---|
type | Stat value type ('Int' or 'Float'). |
Methods
Name | Description |
---|---|
As |
Explicitly casts this Stat |
As |
Explicitly casts this Stat |
Equals(object) | Indicates whether this instance and a specified object are equal. |
Fill |
Reset this object and fill it with the given data. |
Get |
Returns the hash code for this instance. |
To |
Converts this object to a JSON ready dictionary. |
To |
Returns the fully qualified type name of this instance. |
Operators
Name | Description |
---|---|
operator +(Stat |
Add 2 StatValues together. |
operator ==(Stat |
Compare 2 StatValues for equality. |
implicit operator Stat |
Construct a StatValue from an integer. |
implicit operator Stat |
Construct a StatValue from an float. |
implicit operator int(Stat |
The integer value for this stat if its type is 'Int'. |
implicit operator float(Stat |
The float value for this stat if its type is 'Float' else int value cast to a float. |
operator !=(Stat |
Compare 2 StatValues for inequality. |
operator -(Stat |
Subtract StatValue from another StatValue. |