Is this the best way to update an int when a ulong updates without the int overloading?
Basically I want the int to mirror the ulong up to the int limit.
ulong tokensAmount
Basically I want the int to mirror the ulong up to the int limit.
ulong tokensAmount
C#:
private int tokensAmountConverted;
[CommandProperty(AccessLevel.GameMaster)]
public int TokensAmountConverted
{
get
{
return (int)tokensAmount < int.MinValue ? int.MinValue : (int)tokensAmount > int.MaxValue ? int.MaxValue : (int)tokensAmount;
}
set
{
tokensAmountConverted = value;
InvalidateProperties();
}
}
Last edited: