Exemple #1
0
        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;
        }
Exemple #2
0
        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);
        }
Exemple #3
0
        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;
        }
Exemple #5
0
        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;
        }