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 ) ); //} }
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); }
public ClientVariable(String name, Color defaultValue, ClientVariableFlags flags = ClientVariableFlags.None) : this(name, defaultValue, typeof(Color), flags) { }
public ClientVariable(String name, Point defaultValue, ClientVariableFlags flags = ClientVariableFlags.None) : this(name, defaultValue, typeof(Point), flags) { }
public ClientVariable(String name, Rectangle defaultValue, ClientVariableFlags flags = ClientVariableFlags.None) : this(name, defaultValue, typeof(Rectangle), flags) { }
public ClientVariable(String name, Boolean defaultValue, ClientVariableFlags flags = ClientVariableFlags.None) : this(name, defaultValue, typeof(Boolean), flags) { }
public ClientVariable(String name, Vector4 defaultValue, ClientVariableFlags flags = ClientVariableFlags.None) : this(name, defaultValue, typeof(Vector4), flags) { }
public ClientVariable(String name, UInt64 defaultValue, ClientVariableFlags flags = ClientVariableFlags.None) : this(name, defaultValue, typeof(UInt64), flags) { }
public ClientVariable(String name, Int32 defaultValue, ClientVariableFlags flags = ClientVariableFlags.None) : this(name, defaultValue, typeof(Int32), flags) { }
public ClientVariable(string name, short defaultValue, ClientVariableFlags flags = ClientVariableFlags.None) : this(name, defaultValue, typeof(short), flags) { }
public ClientVariable(string name, Size defaultValue, ClientVariableFlags flags = ClientVariableFlags.None) : this(name, defaultValue, typeof(Size), flags) { }
public ClientVariable(string name, ulong defaultValue, ClientVariableFlags flags = ClientVariableFlags.None) : this(name, defaultValue, typeof(ulong), flags) { }