private CVar(string name, CVarType type) { if (name == null) { throw new NullReferenceException("Name is null"); } m_id = ++s_nextId; m_name = name; m_type = type; }
public static CVar Register(string Name, object DefaultVal = null, CVarType Type = CVarType.Default, CVarSetFunc OnSet = null, CVarGetFunc OnGet = null) { if (Find(Name) != null) { throw new Exception("CVar " + Name + " already registered"); } CVar Var = new CVar(Name, DefaultVal, Type, OnSet, OnGet); CVars.Add(Var); return(Var); }
private CVar(string name, CVarType type, CFlags flags) { if (name == null) { throw new NullReferenceException("Name is null"); } m_name = name; m_type = type; m_flags = flags; Register(this); }
private CVar(string name, CVarType type, CFlags flags) { if (name == null) { throw new ArgumentNullException("name"); } m_id = ++s_nextId; m_name = name; m_type = type; m_flags = flags; }
public CVar(string Name, object DefaultValue, CVarType Type, CVarSetFunc OnSet = null, CVarGetFunc OnGet = null) { Info = Name; TriggerOnSet = true; TriggerOnGet = true; this.OnSet = OnSet; this.OnGet = OnGet; this.Name = Name; CVarType = Type; Val = DefaultValue; Value = Val; this.DefaultValue = Value; }