Exemplo n.º 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);
     });
 }
Exemplo n.º 2
0
        internal void InvokeConsoleCommandEvent(Player player, string command)
        {
            var ev = new ConsoleCommandEventArgs {
                Command = command, Player = player
            };

            ConsoleCommandEvent?.Invoke(ev);
        }
Exemplo n.º 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);
    }
Exemplo n.º 4
0
		void HandleConsoleCommand(ConsoleCommandEventArgs args)
		{
			//var id = args.Id;
			//if (args.Id == GetType().Name)
			HandleInput(args.Command);
		}
Exemplo n.º 5
0
 void HandleConsoleCommand(ConsoleCommandEventArgs args)
 {
     //var id = args.Id;
     //if (args.Id == GetType().Name)
     HandleInput(args.Command);
 }