コード例 #1
0
 /// <summary>
 /// Initializes the command system provider
 /// </summary>
 private void Initialize()
 {
     rustCommands           = typeof(ConsoleSystem.Index).GetField("dictionary", BindingFlags.NonPublic | BindingFlags.Static)?.GetValue(null) as IDictionary <string, ConsoleSystem.Command>;
     registeredChatCommands = new Dictionary <string, CommandCallback>();
     chatCommandHandler     = new ChatCommandHandler(ChatCommandCallback, registeredChatCommands.ContainsKey);
     consolePlayer          = new RustConsolePlayer();
 }
コード例 #2
0
ファイル: RustCommandSystem.cs プロジェクト: yas-online/Oxide
 /// <summary>
 /// Initializes the command system provider
 /// </summary>
 private void Initialize()
 {
     rustCommands = typeof(ConsoleSystem.Index).GetField("dictionary", BindingFlags.NonPublic | BindingFlags.Static)?.GetValue(null) as IDictionary<string, ConsoleSystem.Command>;
     registeredChatCommands = new Dictionary<string, CommandCallback>();
     chatCommandHandler = new ChatCommandHandler(ChatCommandCallback, registeredChatCommands.ContainsKey);
     consolePlayer = new RustConsolePlayer();
 }
コード例 #3
0
        public RustCommandSystem()
        {
            this.registeredCommands = new Dictionary <string, RustCommandSystem.RegisteredCommand>();
            CommandCallback commandCallback = new CommandCallback(this.CommandCallback);
            IDictionary <string, RustCommandSystem.RegisteredCommand> strs = this.registeredCommands;

            this.commandHandler = new CommandHandler(commandCallback, new Func <string, bool>(strs.ContainsKey));
            this.consolePlayer  = new RustConsolePlayer();
        }
コード例 #4
0
 /// <summary>
 /// Initializes the command system
 /// </summary>
 public RustCommandSystem()
 {
     registeredCommands = new Dictionary <string, RegisteredCommand>();
     commandHandler     = new CommandHandler(CommandCallback, registeredCommands.ContainsKey);
     consolePlayer      = new RustConsolePlayer();
 }