Beispiel #1
0
        public ClientVariable(String name, Object defaultValue, Type valueType, ClientVariableFlags flags = ClientVariableFlags.None)
        {
            if (String.IsNullOrEmpty(name))
            {
                throw new ArgumentNullException("name");
            }

            Name         = name;
            DefaultValue = defaultValue;
            Value        = DefaultValue;
            ValueType    = valueType;
            Flags        = flags;

            //var 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 ( CommandInstance.Exists( name ) )
            //{
            //    throw new ArgumentException( String.Format( "Can't register variable: {0} is a command!\n", name ) );
            //}
        }
Beispiel #2
0
        public ClientVariable Add <T>(string name, T defaultValue, ClientVariableFlags flags = ClientVariableFlags.None)
        {
            if (this.Contains(name))
            {
                return(null);
            }

            var result = new ClientVariable(name, defaultValue, typeof(T), flags);

            base.Add(name, result);

            return(result);
        }
Beispiel #3
0
 public ClientVariable(String name, Color defaultValue, ClientVariableFlags flags = ClientVariableFlags.None)
     : this(name, defaultValue, typeof(Color), flags)
 {
 }
Beispiel #4
0
 public ClientVariable(String name, Point defaultValue, ClientVariableFlags flags = ClientVariableFlags.None)
     : this(name, defaultValue, typeof(Point), flags)
 {
 }
Beispiel #5
0
 public ClientVariable(String name, Rectangle defaultValue, ClientVariableFlags flags = ClientVariableFlags.None)
     : this(name, defaultValue, typeof(Rectangle), flags)
 {
 }
Beispiel #6
0
 public ClientVariable(String name, Boolean defaultValue, ClientVariableFlags flags = ClientVariableFlags.None)
     : this(name, defaultValue, typeof(Boolean), flags)
 {
 }
Beispiel #7
0
 public ClientVariable(String name, Vector4 defaultValue, ClientVariableFlags flags = ClientVariableFlags.None)
     : this(name, defaultValue, typeof(Vector4), flags)
 {
 }
Beispiel #8
0
 public ClientVariable(String name, UInt64 defaultValue, ClientVariableFlags flags = ClientVariableFlags.None)
     : this(name, defaultValue, typeof(UInt64), flags)
 {
 }
Beispiel #9
0
 public ClientVariable(String name, Int32 defaultValue, ClientVariableFlags flags = ClientVariableFlags.None)
     : this(name, defaultValue, typeof(Int32), flags)
 {
 }
Beispiel #10
0
 public ClientVariable(string name, short defaultValue, ClientVariableFlags flags = ClientVariableFlags.None)
     : this(name, defaultValue, typeof(short), flags)
 {
 }
Beispiel #11
0
 public ClientVariable(string name, Size defaultValue, ClientVariableFlags flags = ClientVariableFlags.None)
     : this(name, defaultValue, typeof(Size), flags)
 {
 }
Beispiel #12
0
 public ClientVariable(string name, ulong defaultValue, ClientVariableFlags flags = ClientVariableFlags.None)
     : this(name, defaultValue, typeof(ulong), flags)
 {
 }