Class DamageSpecifier
This class represents a collection of damage types and damage values.
Inheritance
System.Object
DamageSpecifier
Assembly: Content.Shared.dll
Syntax
public sealed class DamageSpecifier : IEquatable<DamageSpecifier>
Constructors
|
Improve this Doc
View Source
DamageSpecifier()
Constructor that just results in an empty dictionary.
Declaration
|
Improve this Doc
View Source
DamageSpecifier(DamageSpecifier)
Constructor that takes another DamageSpecifier instance and copies it.
Declaration
public DamageSpecifier(DamageSpecifier damageSpec)
Parameters
|
Improve this Doc
View Source
DamageSpecifier(DamageGroupPrototype, FixedPoint2)
Constructor that takes a single damage group prototype and a damage value. The value is divided between members of the damage group.
Declaration
public DamageSpecifier(DamageGroupPrototype group, FixedPoint2 value)
Parameters
|
Improve this Doc
View Source
DamageSpecifier(DamageTypePrototype, FixedPoint2)
Constructor that takes a single damage type prototype and a damage value.
Declaration
public DamageSpecifier(DamageTypePrototype type, FixedPoint2 value)
Parameters
Properties
|
Improve this Doc
View Source
DamageDict
Main DamageSpecifier dictionary. Most DamageSpecifier functions exist to somehow modifying this.
Declaration
public Dictionary<string, FixedPoint2> DamageDict { get; set; }
Property Value
Type |
Description |
Dictionary<System.String, FixedPoint2> |
|
|
Improve this Doc
View Source
Empty
Whether this damage specifier has any entries.
Declaration
public bool Empty { get; }
Property Value
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
Total
Sum of the damage values.
Declaration
public FixedPoint2 Total { get; }
Property Value
Methods
|
Improve this Doc
View Source
ApplyModifierSet(DamageSpecifier, DamageModifierSet)
Reduce (or increase) damages by applying a damage modifier set.
Declaration
public static DamageSpecifier ApplyModifierSet(DamageSpecifier damageSpec, DamageModifierSet modifierSet)
Parameters
Returns
|
Improve this Doc
View Source
ApplyModifierSets(DamageSpecifier, IEnumerable<DamageModifierSet>)
Reduce (or increase) damages by applying multiple modifier sets.
Declaration
public static DamageSpecifier ApplyModifierSets(DamageSpecifier damageSpec, IEnumerable<DamageModifierSet> modifierSets)
Parameters
Returns
|
Improve this Doc
View Source
Clamp(FixedPoint2, FixedPoint2)
Clamps each damage value to be within the given range.
Declaration
public void Clamp(FixedPoint2 minValue, FixedPoint2 maxValue)
Parameters
|
Improve this Doc
View Source
ClampMax(FixedPoint2)
Sets all damage values to be at most some number. Note that if a damage type is not present in the
dictionary, these will not be added.
Declaration
public void ClampMax(FixedPoint2 maxValue)
Parameters
|
Improve this Doc
View Source
ClampMin(FixedPoint2)
Sets all damage values to be at least as large as the given number.
Declaration
public void ClampMin(FixedPoint2 minValue)
Parameters
|
Improve this Doc
View Source
Equals(DamageSpecifier)
Declaration
public bool Equals(DamageSpecifier other)
Parameters
Returns
Type |
Description |
System.Boolean |
|
|
Improve this Doc
View Source
ExclusiveAdd(DamageSpecifier)
This adds the damage values of some other DamageSpecifier to the current one without
adding any new damage types.
Declaration
public void ExclusiveAdd(DamageSpecifier other)
Parameters
|
Improve this Doc
View Source
GetDamagePerGroup(IPrototypeManager)
Returns a dictionary using ID keys, with values calculated by adding
up the values for each damage type in that group
Declaration
public Dictionary<string, FixedPoint2> GetDamagePerGroup(IPrototypeManager protoManager = null)
Parameters
Type |
Name |
Description |
Robust.Shared.Prototypes.IPrototypeManager |
protoManager |
|
Returns
Type |
Description |
Dictionary<System.String, FixedPoint2> |
|
|
Improve this Doc
View Source
TrimZeros()
Remove any damage entries with zero damage.
Declaration
|
Improve this Doc
View Source
TryGetDamageInGroup(DamageGroupPrototype, out FixedPoint2)
Add up all the damage values for damage types that are members of a given group.
Declaration
public bool TryGetDamageInGroup(DamageGroupPrototype group, out FixedPoint2 total)
Parameters
Returns
Type |
Description |
System.Boolean |
|
Operators
|
Improve this Doc
View Source
Addition(DamageSpecifier, DamageSpecifier)
Declaration
public static DamageSpecifier operator +(DamageSpecifier damageSpecA, DamageSpecifier damageSpecB)
Parameters
Returns
|
Improve this Doc
View Source
Division(DamageSpecifier, FixedPoint2)
Declaration
public static DamageSpecifier operator /(DamageSpecifier damageSpec, FixedPoint2 factor)
Parameters
Returns
|
Improve this Doc
View Source
Division(DamageSpecifier, Single)
Declaration
public static DamageSpecifier operator /(DamageSpecifier damageSpec, float factor)
Parameters
Returns
|
Improve this Doc
View Source
Multiply(DamageSpecifier, FixedPoint2)
Declaration
public static DamageSpecifier operator *(DamageSpecifier damageSpec, FixedPoint2 factor)
Parameters
Returns
|
Improve this Doc
View Source
Multiply(DamageSpecifier, Single)
Declaration
public static DamageSpecifier operator *(DamageSpecifier damageSpec, float factor)
Parameters
Returns
|
Improve this Doc
View Source
Multiply(FixedPoint2, DamageSpecifier)
Declaration
public static DamageSpecifier operator *(FixedPoint2 factor, DamageSpecifier damageSpec)
Parameters
Returns
|
Improve this Doc
View Source
Multiply(Single, DamageSpecifier)
Declaration
public static DamageSpecifier operator *(float factor, DamageSpecifier damageSpec)
Parameters
Returns
|
Improve this Doc
View Source
Subtraction(DamageSpecifier, DamageSpecifier)
Declaration
public static DamageSpecifier operator -(DamageSpecifier damageSpecA, DamageSpecifier damageSpecB)
Parameters
Returns
|
Improve this Doc
View Source
UnaryNegation(DamageSpecifier)
Declaration
public static DamageSpecifier operator -(DamageSpecifier damageSpec)
Parameters
Returns
|
Improve this Doc
View Source
UnaryPlus(DamageSpecifier)
Declaration
public static DamageSpecifier operator +(DamageSpecifier damageSpec)
Parameters
Returns