Method TryGetValue
TryGetValue(GameItem, StatDefinition, out StatValue)
Try to get specified StatDefinition from specified GameItem and output StatValue, if found.
Declaration
public static bool TryGetValue(GameItem gameItem, StatDefinition statDefinition, out StatValue value)
Parameters
Type | Name | Description |
---|---|---|
Game |
gameItem | The GameItem to check for specified StatDefinition. |
Stat |
statDefinition | StatDefinition this method is to act upon. |
Stat |
value | StatValue if found. |
Returns
Type | Description |
---|---|
bool | True if specified Stat exists and is set on specified GameItem, else false. |
Exceptions
Type | Condition |
---|---|
Argument |
If the gameItem argument is null. |
Argument |
If the statDefinition argument is null. |
Detail |
If the StatDetail is not found on GameItem. |
Stat |
If the StatDefinition is not found. |
TryGetValue(GameItem, string, out StatValue)
Search for specified StatDefinition from specified GameItem and output StatValue, if found.
Declaration
public static bool TryGetValue(GameItem gameItem, string statDefinitionId, out StatValue value)
Parameters
Type | Name | Description |
---|---|---|
Game |
gameItem | The GameItem to check for specified StatDefinition. |
string | statDefinitionId | Id of StatDefinition this method is to act upon. |
Stat |
value | StatValue if found. |
Returns
Type | Description |
---|---|
bool | True if specified Stat exists and is set on specified GameItem, else false. |
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. |
TryGetValue(string, StatDefinition, out StatValue)
Search for specified StatDefinition from specified GameItem and output StatValue, if found.
Declaration
public static bool TryGetValue(string gameItemId, StatDefinition statDefinition, out StatValue value)
Parameters
Type | Name | Description |
---|---|---|
string | gameItemId | GameItem upon which StatManager is to check for stat. |
Stat |
statDefinition | StatDefinition this method is to act upon. |
Stat |
value | StatValue if found. |
Returns
Type | Description |
---|---|
bool | True if specified Stat exists and is set on specified GameItem, else false. |
Exceptions
Type | Condition |
---|---|
Argument |
If the gameItemId is null or empty. |
Inventory |
If the gameItemId is not found. |
Argument |
If the statDefinition argument is null. |
Detail |
If the StatDetail is not found on GameItem. |
Stat |
If the StatDefinition is not found. |
TryGetValue(string, string, out StatValue)
Search for specified StatDefinition from specified GameItem and output StatValue, if found.
Declaration
public static bool TryGetValue(string gameItemId, string statDefinitionId, out StatValue value)
Parameters
Type | Name | Description |
---|---|---|
string | gameItemId | GameItem upon which StatManager is to check for stat. |
string | statDefinitionId | Id of StatDefinition this method is to act upon. |
Stat |
value | StatValue if found. |
Returns
Type | Description |
---|---|
bool | True if specified Stat exists and is set on specified GameItem, else false. |
Exceptions
Type | Condition |
---|---|
Argument |
If the gameItemId is null or empty. |
Inventory |
If the gameItemId is not found. |
Argument |
If the statDefinitionId is null or empty. |
Detail |
If the StatDetail is not found on GameItem. |
Stat |
If the StatDefinition is not found. |