Method AdjustValue
AdjustValue(GameItem, StatDefinition, StatValue)
Adjusts specified StatDefinition on specified gameItem by specified amount.
Declaration
public static StatValue AdjustValue(GameItem gameItem, StatDefinition statDefinition, StatValue change)
Parameters
Type | Name | Description |
---|---|---|
Game |
gameItem | GameItem upon which Stat is to be adjusted. |
Stat |
statDefinition | StatDefinition this method is to act upon. |
Stat |
change | Adjustment (positive or negative) to Stat. |
Returns
Type | Description |
---|---|
Stat |
The new value of Stat on GameItem. |
Exceptions
Type | Condition |
---|---|
Argument |
If the gameItem argument is null. |
Argument |
If the statDefinition argument is null. |
Exception | If the statDefinition not found on game item. |
Invalid |
If the StatValueType doesn't match StatDefinition. |
Detail |
If the StatDetail is not found on GameItem. |
Stat |
If the StatDefinition is not found. |
AdjustValue(GameItem, string, StatValue)
Adjusts specified StatDefinition on specified gameItem by specified amount.
Declaration
public static StatValue AdjustValue(GameItem gameItem, string statDefinitionId, StatValue change)
Parameters
Type | Name | Description |
---|---|---|
Game |
gameItem | GameItem upon which Stat is to be adjusted. |
string | statDefinitionId | Id of StatDefinition this method is to act upon. |
Stat |
change | Adjustment (positive or negative) to Stat. |
Returns
Type | Description |
---|---|
Stat |
The new value of Stat on GameItem. |
Exceptions
Type | Condition |
---|---|
Argument |
If the gameItem argument is null. |
Argument |
If the statDefinitionId is null or empty. |
Detail |
If the StatDetail is not found on GameItem. |
Stat |
If the StatDefinition is not found. |
Exception | If the statDefinition not found on game item. |
Stat |
If the StatDefinition is not found. |