Beispiel #1
0
        // Without flags
        public static ConsoleVarNode Set(string var_name, string var_value)
        {
            ConsoleVarNode Result = FindVar(var_name);

            if (Result != null)
            {
                Result.Name  = var_name;
                Result.Value = var_value;
            }

            return(Result);
        }
Beispiel #2
0
        public static ushort GetValueToUShort(string Name)
        {
            ConsoleVarNode Node = FindVar(Name);

            if (Node != null)
            {
                return(ConvertX.ToUShort(Node.Value, 0, "", "trim", 0));
            }
            else
            {
                return(0);
            }
        }
Beispiel #3
0
        public static string GetValueToString(string Name)
        {
            ConsoleVarNode Node = FindVar(Name);

            if (Node != null)
            {
                return(Node.Value);
            }
            else
            {
                return("");
            }
        }
Beispiel #4
0
        public static ConsoleVarNode SetOrCreate(string var_name, string var_value, uint flags)
        {
            ConsoleVarNode Result = FindVar(var_name);

            if (Result == null)
            {
                Result = Create(var_name, var_value, flags);
            }
            else
            {
                Result = Set(var_name, var_value, flags);
            }

            return(Result);
        }
Beispiel #5
0
        public static ConsoleVarNode Create(string var_name, string var_value, uint flags)
        {
            ConsoleVarNode Result = FindVar(var_name);

            // If the variable not found, then add a new one.
            if (Result == null)
            {
                ConsoleVarNode Node = new ConsoleVarNode();

                Node.Name  = var_name;
                Node.Value = var_value;
                Node.Flags = flags;

                ConsoleVars.Add(var_name, Node);

                Result = Node;
            }

            return(Result);
        }