Method TryDecrementToMin
TryDecrementToMin(ref int, int)
Attempts to decrement the specified value up to a maximum value.
Declaration
public static bool TryDecrementToMin(ref int location, int minValue)
Parameters
| Type | Name | Description |
|---|---|---|
| int | location | The location to be decremented. |
| int | minValue | The minimum value to which the location can be decremented. |
Returns
| Type | Description |
|---|---|
| bool | true if the value was successfully decremented; otherwise, false if the current value is already at or below the minimum value. |
TryDecrementToMin(ref int, int, out int)
Attempts to decrement the specified value up to a maximum value.
Declaration
public static bool TryDecrementToMin(ref int location, int minValue, out int newValue)
Parameters
| Type | Name | Description |
|---|---|---|
| int | location | The location to be decremented. |
| int | minValue | The minimum value to which the location can be decremented. |
| int | newValue | When this method returns, contains the new value if the decrement was successful, or the current value if the minimum was reached. |
Returns
| Type | Description |
|---|---|
| bool | true if the value was successfully decremented; otherwise, false if the current value is already at or below the minimum value. |