|
1 | 1 | using System; |
2 | | -using System.Collections.Generic; |
3 | 2 |
|
4 | 3 | namespace Rocket.API.Commands |
5 | 4 | { |
6 | 5 | /// <summary> |
7 | | - /// Base interface for commands.<br/> |
8 | | - /// Commands are usually executed ingame by players or by the console. They are |
9 | | - /// a human interface to plugin functionalities which allow to do specific actions. |
10 | | - /// <br/><br/> |
11 | | - /// <b>Example commands: </b>/help, /tp, /heal, etc... |
12 | | - /// <br/><br/> |
13 | | - /// In the default implementation, these non abstract classes inheriting this interface are automatically found |
14 | | - /// and registered to the plugin. |
15 | | - /// <br/><br/> |
16 | | - /// Usually commands are not called by plugins programatically. |
| 6 | + /// Base interface for commands.<br /> |
| 7 | + /// Commands are usually executed ingame by players or by the console. They are |
| 8 | + /// a human interface to plugin functionalities which allow to do specific actions. |
| 9 | + /// <br /><br /> |
| 10 | + /// <b>Example commands: </b>/help, /tp, /heal, etc... |
| 11 | + /// <br /><br /> |
| 12 | + /// In the default implementation, these non abstract classes inheriting this interface are automatically found |
| 13 | + /// and registered to the plugin. |
| 14 | + /// <br /><br /> |
| 15 | + /// Usually commands are not called by plugins programatically. |
17 | 16 | /// </summary> |
18 | 17 | public interface ICommand |
19 | 18 | { |
20 | 19 | /// <summary> |
21 | | - /// The primary name of the command, which will be used to execute it.<br/> |
22 | | - /// For example, if the name is "Help", the command will be usually be called using "/heal" (or just "heal" in console)<br/><br/> |
23 | | - /// The primary name overrides any <see cref="Aliases">aliases</see> of other commands by default.<br/><br/> |
24 | | - /// <b>This property must never return null.</b> |
| 20 | + /// The primary name of the command, which will be used to execute it.<br /> |
| 21 | + /// For example, if the name is "Help", the command will be usually be called using "/heal" (or just "heal" in console) |
| 22 | + /// <br /><br /> |
| 23 | + /// The primary name overrides any <see cref="Aliases">aliases</see> of other commands by default.<br /><br /> |
| 24 | + /// <b>This property must never return null.</b> |
25 | 25 | /// </summary> |
26 | 26 | string Name { get; } |
27 | 27 |
|
28 | 28 | /// <summary> |
29 | | - /// The aliases of the command, which are often shorter versions of the primary name. |
30 | | - /// For example, if the aliases are "h" and "he", the command will be callable using "/h" or "/he" too.<br/><br/> |
31 | | - /// <b>This property can return null.</b> |
| 29 | + /// The aliases of the command, which are often shorter versions of the primary name. |
| 30 | + /// For example, if the aliases are "h" and "he", the command will be callable using "/h" or "/he" too.<br /><br /> |
| 31 | + /// <b>This property can return null.</b> |
32 | 32 | /// </summary> |
33 | 33 | string[] Aliases { get; } |
34 | 34 |
|
35 | 35 | /// <summary> |
36 | | - /// The description of the command.<br/> |
37 | | - /// Example: <code>"This command heals you or someone else."</code> |
38 | | - /// <b>This proprty can return null</b> but its advised to always include a description for the command. |
| 36 | + /// The description of the command.<br /> |
| 37 | + /// Example: <code>"This command heals you or someone else."</code> |
| 38 | + /// <b>This proprty can return null</b> but its advised to always include a description for the command. |
39 | 39 | /// </summary> |
40 | 40 | string Description { get; } |
41 | 41 |
|
42 | 42 | /// <summary> |
43 | | - /// The permission required to execute the command. |
44 | | - /// Example: <code>MyPermission.Heal</code> |
45 | | - /// <b>This property can return null.</b><br/><br/> |
| 43 | + /// The permission required to execute the command. |
| 44 | + /// Example: <code>MyPermission.Heal</code> |
| 45 | + /// <b>This property can return null.</b><br /><br /> |
46 | 46 | /// </summary> |
47 | 47 | /// <remarks> |
48 | | - /// When returning null, the default permission will be used, which depends on the <see cref="ICommandHandler"/> implementation.<br/> |
49 | | - /// The default CommandHandler uses {PluginName}.{CommandName} (e.g. "MyPlugin.Heal") as permission. |
| 48 | + /// When returning null, the default permission will be used, which depends on the <see cref="ICommandHandler" /> |
| 49 | + /// implementation.<br /> |
| 50 | + /// The default CommandHandler uses {PluginName}.{CommandName} (e.g. "MyPlugin.Heal") as permission. |
50 | 51 | /// </remarks> |
51 | 52 | string Permission { get; } |
52 | 53 |
|
53 | 54 | /// <summary> |
54 | | - /// The command syntax will be shown to the <see cref="ICommandCaller"/> when the command was not used correctly.<br/><br/> |
55 | | - /// <b>Example usage:</b> <code>"[player] <amount>"</code> |
56 | | - /// An output for the above example could be "/heal [player] <amount>".<br/><br/> |
57 | | - /// <b>This property must never return null.</b> |
| 55 | + /// The command syntax will be shown to the <see cref="ICommandCaller" /> when the command was not used correctly. |
| 56 | + /// <br /><br /> |
| 57 | + /// <b>Example usage:</b> <code>"[player] <amount>"</code> |
| 58 | + /// An output for the above example could be "/heal [player] <amount>".<br /><br /> |
| 59 | + /// <b>This property must never return null.</b> |
58 | 60 | /// </summary> |
59 | 61 | /// <remarks> |
60 | | - /// [...] means optional argument and <...> means required argument, so in this case "player" is an optional argument while "amount" is a required one. |
| 62 | + /// [...] means optional argument and <...> means required argument, so in this case "player" is an optional |
| 63 | + /// argument while "amount" is a required one. |
61 | 64 | /// </remarks> |
62 | 65 | string Syntax { get; } |
63 | 66 |
|
64 | 67 | /// <summary> |
65 | | - /// The child commands of this command. <br/><br/> |
66 | | - /// <b>Example:</b><br/> |
67 | | - /// Assume a command was entered as "/mycommand sub". If the <see cref="Name">name</see> or an <see cref="Aliases">alias</see> of this command equals "mycommand" and a child command with the <see cref="Name">name</see> |
68 | | - /// or an <see cref="Aliases">alias</see> "sub" exists, then the <see cref="Execute">Execute</see> method of the child command will be called. |
69 | | - /// The <see cref="Execute">Execute</see> method of the parent will not be called.<br/><br/> |
70 | | - /// <b>This property can return null.</b><br/><br/> |
71 | | - /// <seealso cref="ISubCommand"/> |
| 68 | + /// The child commands of this command. <br /><br /> |
| 69 | + /// <b>Example:</b><br /> |
| 70 | + /// Assume a command was entered as "/mycommand sub". If the <see cref="Name">name</see> or an |
| 71 | + /// <see cref="Aliases">alias</see> of this command equals "mycommand" and a child command with the |
| 72 | + /// <see cref="Name">name</see> |
| 73 | + /// or an <see cref="Aliases">alias</see> "sub" exists, then the <see cref="Execute">Execute</see> method of the child |
| 74 | + /// command will be called. |
| 75 | + /// The <see cref="Execute">Execute</see> method of the parent will not be called.<br /><br /> |
| 76 | + /// <b>This property can return null.</b><br /><br /> |
| 77 | + /// <seealso cref="ISubCommand" /> |
72 | 78 | /// </summary> |
73 | 79 | ISubCommand[] ChildCommands { get; } |
74 | 80 |
|
75 | 81 | /// <summary> |
76 | | - /// Defines if this command can be executed by the given command caller type. |
77 | | - /// It is guaranteed that <see cref="Execute"/> can only be called by supported command callers. |
| 82 | + /// Defines if this command can be executed by the given command caller type. |
| 83 | + /// It is guaranteed that <see cref="Execute" /> can only be called by supported command callers. |
78 | 84 | /// </summary> |
79 | 85 | /// <param name="commandCaller">The command caller type to check.</param> |
80 | 86 | /// <returns><b>true</b> if the given command caller type can execute this command; otherwise, <b>false</b>.</returns> |
81 | 87 | bool SupportsCaller(Type commandCaller); |
82 | 88 |
|
83 | 89 | /// <summary> |
84 | | - /// This method is called when a command caller wants to execute this command.<br/><br/> |
85 | | - /// <b>Example</b><br/> |
86 | | - /// Assume a command was entered as "/mycommand". If the <see cref="Name">name</see> or |
87 | | - /// an <see cref="Aliases">alias</see> of this command equals "mycommand", then this method will be executed.</summary> |
| 90 | + /// This method is called when a command caller wants to execute this command.<br /><br /> |
| 91 | + /// <b>Example</b><br /> |
| 92 | + /// Assume a command was entered as "/mycommand". If the <see cref="Name">name</see> or |
| 93 | + /// an <see cref="Aliases">alias</see> of this command equals "mycommand", then this method will be executed. |
| 94 | + /// </summary> |
88 | 95 | /// <param name="context">The <see cref="ICommandContext">context</see> of the command.</param> |
89 | 96 | void Execute(ICommandContext context); |
90 | 97 | } |
|
0 commit comments