Ejemplo n.º 1
0
 /// <summary>
 /// Add new command for this console.
 /// </summary>
 /// <param name="prefix">Prefix of the command.</param>
 /// <param name="execution">Execution callback function.</param>
 public void AddCommand(string prefix, LuviCommandExecution execution)
 {
     if (!commandData.ContainsKey(prefix))
         commandData.Add(prefix, execution);
     else
         throw new InvalidOperationException($"Already have {prefix} command.");
 }
Ejemplo n.º 2
0
 public CommandData(string name, string description, LuviCommandExecution execution, bool executeImmediately = false, string group = null)
 {
     this.name               = name;
     this.description        = description;
     this.execution          = execution;
     this.executeImmediately = executeImmediately;
     this.group              = group;
 }
Ejemplo n.º 3
0
 public void AddCommand(string prefix, string name, string description, LuviCommandExecution execution, bool executeImmediately = false, string group = null)
 {
     if (!commandData.ContainsKey(prefix))
     {
         commandData.Add(prefix, new CommandData(name, description, execution, executeImmediately, group));
         commandData.OrderBy(member => member.Value.group);
     }
     else
     {
         Debug.LogWarning($"Luvi Console already have {prefix} command, Disposed.");
     }
 }