Example #1
0
 public static void SetFunc(string name, ConsoleFunction func)
 {
     lock (_varables)
         if (_varables.Contains(name))
         {
             _functions[name] = func;
         }
         else
         {
             _functions.Add(name, func);
         }
 }
Example #2
0
        public static void Init(int backlogLength = 500)
        {
            _varables       = new HashDictionary <string, ConsoleVarable>();
            _functions      = new HashDictionary <string, ConsoleFunction>();
            _consoleBacklog = new LimitedList <string>(backlogLength, string.Empty);
            _backlogLine    = "";

            ConsoleFunction ConsoleHelp = new ConsoleFunction()
            {
                Function    = ConsoleHelpFunc,
                HelpInfo    = DefaultLanguage.Strings.GetString("Console_Help_Help"),
                TabFunction = ConsoleHelpTab
            };

            SetFunc("help", ConsoleHelp);
        }