r2mods/ilspy_dump/ror2_csproj/RoR2.ConVar/IntConVar.cs

25 lines
495 B
C#
Raw Normal View History

2024-10-04 07:26:37 +00:00
namespace RoR2.ConVar;
public class IntConVar : BaseConVar
{
public int value { get; protected set; }
public IntConVar(string name, ConVarFlags flags, string defaultValue, string helpText)
: base(name, flags, defaultValue, helpText)
{
}
public override void SetString(string newValue)
{
if (TextSerialization.TryParseInvariant(newValue, out int result))
{
value = result;
}
}
public override string GetString()
{
return TextSerialization.ToStringInvariant(value);
}
}