public static ConVar <T> Register <T>(string Name, T Value, ConVarType Type = ConVarType.Default) { ConVar <T> CVar = new ConVar <T>(Name, Value, Type); ConItems.Register(Name, CVar); return(CVar); }
public static dynamic Parse(string t, ConVarType cvt) { switch (cvt) { case ConVarType.String: return(t); case ConVarType.Integer: return(int.Parse(t)); case ConVarType.Float: return(float.Parse(t)); case ConVarType.Double: return(double.Parse(t)); case ConVarType.Boolean: return(t == "true" || t == "yes" || t == "1"); } throw new ArgumentException("Failed to parse your input!"); }
protected ConVar(string Name, ConVarType Type) : base(Name) { this.Type = Type; }
public void SetType(Type t) { ValueType = ToConVarType(t); }