Beispiel #1
0
 /// <summary>
 /// Handles a console command.
 /// </summary>
 /// <param name="sender">The sending object.</param>
 /// <param name="e">The event data.</param>
 public void CommandInputHandle(object sender, ConsoleCommandEventArgs e)
 {
     Schedule.ScheduleSyncTask(() =>
     {
         Commands.ExecuteCommands(e.Command);
     });
 }
Beispiel #2
0
        internal void InvokeConsoleCommandEvent(Player player, string command)
        {
            var ev = new ConsoleCommandEventArgs {
                Command = command, Player = player
            };

            ConsoleCommandEvent?.Invoke(ev);
        }
Beispiel #3
0
    private void OnCommandEntered(ConsoleCommandEventArgs eventArgs)
    {
      var handler = CommandEntered;

      try
      {
        if (handler != null)
          handler(this, eventArgs);
      }
      catch (Exception exception)
      {
        // We catch all exceptions and print them.
        WriteLine(exception.Message);
      }

      // At last call default interpreter.
      Interpreter.Interpret(eventArgs);
    }
		void HandleConsoleCommand(ConsoleCommandEventArgs args)
		{
			//var id = args.Id;
			//if (args.Id == GetType().Name)
			HandleInput(args.Command);
		}
Beispiel #5
0
 void HandleConsoleCommand(ConsoleCommandEventArgs args)
 {
     //var id = args.Id;
     //if (args.Id == GetType().Name)
     HandleInput(args.Command);
 }