Esempio n. 1
0
File: Cvar.cs Progetto: Scrama/Quarp
        public Cvar(string name, string value, bool archive, bool server)
        {
            if (String.IsNullOrEmpty(name))
            {
                throw new ArgumentNullException("name");
            }
            Cvar var = Find(name);

            if (var != null)
            {
                throw new ArgumentException(String.Format("Can't register variable {0}, already defined!\n", name));
                //Con_Printf("Can't register variable %s, allready defined\n", variable->name);
                //return;
            }
            if (Cmd.Exists(name))
            {
                throw new ArgumentException(String.Format("Can't register variable: {0} is a command!\n", name));
            }
            _Next = _Vars;
            _Vars = this;

            _Name   = name;
            _String = value;
            _Flags[Flags.Archive] = archive;
            _Flags[Flags.Server]  = server;
            _Value = Common.atof(_String);
        }