Skip to content
This repository was archived by the owner on Jan 16, 2020. It is now read-only.

Commit 3f55efb

Browse files
committed
Apply code style
1 parent e7fbd87 commit 3f55efb

114 files changed

Lines changed: 1189 additions & 1304 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Rocket.API/App.config

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,11 @@
11
<?xml version="1.0" encoding="utf-8"?>
2+
23
<configuration>
34
<configSections>
4-
5-
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
5+
6+
<section name="entityFramework"
7+
type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"
8+
requirePermission="false" />
69
</configSections>
710
<entityFramework>
811
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />

Rocket.API/Chat/IChatManager.cs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using Rocket.API.I18N;
2-
using Rocket.API.Player;
1+
using Rocket.API.Player;
32

43
namespace Rocket.API.Chat
54
{
@@ -8,18 +7,18 @@ namespace Rocket.API.Chat
87
public interface IChatManager
98
{
109
/// <summary>
11-
/// Sends a message to the given player
10+
/// Sends a message to the given player
1211
/// </summary>
1312
/// <param name="player">The receiver of the message</param>
1413
/// <param name="message">The message to send</param>
1514
/// <param name="bindings">The bindings for the message</param>
1615
void SendMessage(IOnlinePlayer player, string message, params object[] bindings);
1716

1817
/// <summary>
19-
/// Broadcasts a message to all players
18+
/// Broadcasts a message to all players
2019
/// </summary>
2120
/// <param name="message">The message to broadcast</param>
22-
/// <param name="bindings">The bindings for the message</param>
21+
/// <param name="bindings">The bindings for the message</param>
2322
void Broadcast(string message, params object[] bindings);
2423
}
2524
}

Rocket.API/Commands/ICommand.cs

Lines changed: 51 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,90 +1,97 @@
11
using System;
2-
using System.Collections.Generic;
32

43
namespace Rocket.API.Commands
54
{
65
/// <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.
1716
/// </summary>
1817
public interface ICommand
1918
{
2019
/// <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>
2525
/// </summary>
2626
string Name { get; }
2727

2828
/// <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>
3232
/// </summary>
3333
string[] Aliases { get; }
3434

3535
/// <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.
3939
/// </summary>
4040
string Description { get; }
4141

4242
/// <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 />
4646
/// </summary>
4747
/// <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.
5051
/// </remarks>
5152
string Permission { get; }
5253

5354
/// <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] &lt;amount&gt;"</code>
56-
/// An output for the above example could be "/heal [player] &lt;amount&gt;".<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] &lt;amount&gt;"</code>
58+
/// An output for the above example could be "/heal [player] &lt;amount&gt;".<br /><br />
59+
/// <b>This property must never return null.</b>
5860
/// </summary>
5961
/// <remarks>
60-
/// [...] means optional argument and &lt;...&gt; means required argument, so in this case "player" is an optional argument while "amount" is a required one.
62+
/// [...] means optional argument and &lt;...&gt; means required argument, so in this case "player" is an optional
63+
/// argument while "amount" is a required one.
6164
/// </remarks>
6265
string Syntax { get; }
6366

6467
/// <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" />
7278
/// </summary>
7379
ISubCommand[] ChildCommands { get; }
7480

7581
/// <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.
7884
/// </summary>
7985
/// <param name="commandCaller">The command caller type to check.</param>
8086
/// <returns><b>true</b> if the given command caller type can execute this command; otherwise, <b>false</b>.</returns>
8187
bool SupportsCaller(Type commandCaller);
8288

8389
/// <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>
8895
/// <param name="context">The <see cref="ICommandContext">context</see> of the command.</param>
8996
void Execute(ICommandContext context);
9097
}
Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,26 @@
11
using System;
2-
using Rocket.API.Chat;
3-
using Rocket.API.I18N;
42
using Rocket.API.Permissions;
5-
using Rocket.API.Player;
63

74
namespace Rocket.API.Commands
85
{
96
/// <summary>
10-
/// A command caller can execute commands.
7+
/// A command caller can execute commands.
118
/// </summary>
129
public interface ICommandCaller : IPermissible
1310
{
1411
/// <summary>
15-
/// The type of the command caller. Wrappers should declare their parents, everything else should declare itself.<br/><br/>
16-
/// <b>This property will never return null.</b>
12+
/// The type of the command caller. Wrappers should declare their parents, everything else should declare itself.<br />
13+
/// <br />
14+
/// <b>This property will never return null.</b>
1715
/// </summary>
1816
Type CallerType { get; }
1917

2018
/// <summary>
21-
/// Send a message to the command caller.
19+
/// Send a message to the command caller.
2220
/// </summary>
2321
/// <param name="message">The message to send.</param>
2422
/// <param name="color">The color of the message. Depending on the caller implementation, it may not be used.</param>
25-
/// <param name="bindings">The bindings for the message. See <see cref="string.Format(string, object[])"/></param>
23+
/// <param name="bindings">The bindings for the message. See <see cref="string.Format(string, object[])" /></param>
2624
void SendMessage(string message, ConsoleColor? color = null, params object[] bindings);
2725
}
2826
}

Rocket.API/Commands/ICommandContext.cs

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -3,54 +3,55 @@
33
namespace Rocket.API.Commands
44
{
55
/// <summary>
6-
/// A command execution context. Includes various information about the environment the command was called in.
6+
/// A command execution context. Includes various information about the environment the command was called in.
77
/// </summary>
88
public interface ICommandContext
99
{
1010
/// <summary>
11-
/// If the command is a
11+
/// If the command is a
1212
/// </summary>
1313
ICommandContext ParentCommandContext { get; }
1414

1515
/// <summary>
16-
/// The prefix used to call this command.<br/>
17-
/// Useful when sending command usage messages.<br/><br/>
18-
/// <b>Example:</b><br/>
19-
/// When the command was executed using "/mycommand", it will be "/", when it was executed using "!mycommand", it will be "!".<br/><br/>
20-
/// <see cref="ISubCommand">Sub commands</see> include their parents: <br/>
21-
/// "/mycommand sub" will return "/mycommand" as prefix.
16+
/// The prefix used to call this command.<br />
17+
/// Useful when sending command usage messages.<br /><br />
18+
/// <b>Example:</b><br />
19+
/// When the command was executed using "/mycommand", it will be "/", when it was executed using "!mycommand", it will
20+
/// be "!".<br /><br />
21+
/// <see cref="ISubCommand">Sub commands</see> include their parents: <br />
22+
/// "/mycommand sub" will return "/mycommand" as prefix.
2223
/// </summary>
2324
/// <remarks>
2425
/// </remarks>
2526
string CommandPrefix { get; }
2627

2728
/// <summary>
28-
/// The alias or name used to execute this command.
29+
/// The alias or name used to execute this command.
2930
/// </summary>
3031
string CommandAlias { get; }
3132

3233
/// <summary>
33-
/// The command associated with the context.
34-
/// <b>This property will never return null.</b>
34+
/// The command associated with the context.
35+
/// <b>This property will never return null.</b>
3536
/// </summary>
3637
ICommand Command { get; }
3738

3839
/// <summary>
39-
/// The caller of the command.<br/>
40-
/// Is guaranteed to be a <see cref="ICommand.SupportsCaller">supported command caller</see>.<br/><br/>
41-
/// <b>This property will never return null.</b>
40+
/// The caller of the command.<br />
41+
/// Is guaranteed to be a <see cref="ICommand.SupportsCaller">supported command caller</see>.<br /><br />
42+
/// <b>This property will never return null.</b>
4243
/// </summary>
4344
ICommandCaller Caller { get; }
4445

4546
/// <summary>
46-
/// The parameters of the command.
47-
/// <b>This property will never return null.</b>
47+
/// The parameters of the command.
48+
/// <b>This property will never return null.</b>
4849
/// </summary>
4950
ICommandParameters Parameters { get; }
5051

5152
/// <summary>
52-
/// The IoC container of the context.
53-
/// <b>This property will never return null.</b>
53+
/// The IoC container of the context.
54+
/// <b>This property will never return null.</b>
5455
/// </summary>
5556
IDependencyContainer Container { get; }
5657
}

Rocket.API/Commands/ICommandHandler.cs

Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,36 +4,39 @@
44
namespace Rocket.API.Commands
55
{
66
/// <summary>
7-
/// The service responsible for handling commands.
7+
/// The service responsible for handling commands.
88
/// </summary>
99
public interface ICommandHandler : IProxyableService
1010
{
1111
/// <summary>
1212
/// Handles a command
1313
/// </summary>
14-
/// <param name="caller">The <see cref="ICommandCaller">command caller</see> of the command. Guaranteed to be a <see cref="SupportsCaller">supported command caller</see>.</param>
14+
/// <param name="caller">
15+
/// The <see cref="ICommandCaller">command caller</see> of the command. Guaranteed to be a
16+
/// <see cref="SupportsCaller">supported command caller</see>.
17+
/// </param>
1518
/// <param name="commandLine">The command line (e.g. "/mycommand sub").</param>
1619
/// <param name="prefix">The <see cref="ICommandContext.CommandPrefix">prefix</see> of the command.</param>
1720
/// <returns><b>true</b> if the command was handled; otherwise, <b>false</b>.</returns>
1821
/// <remarks>
19-
/// When returning false, the next command handler will be called.
20-
/// If no command handler could handle the command, it will be assumed that the command does not exist.
22+
/// When returning false, the next command handler will be called.
23+
/// If no command handler could handle the command, it will be assumed that the command does not exist.
2124
/// </remarks>
2225
bool HandleCommand(ICommandCaller caller, string commandLine, string prefix);
2326

2427
/// <summary>
25-
/// Defines if this command handler can handle the given command caller type.
28+
/// Defines if this command handler can handle the given command caller type.
2629
/// </summary>
2730
/// <param name="commandCaller">The <see cref="ICommandCaller">command caller</see> type to check.</param>
2831
/// <returns><b>true</b> if the command caller type is supported; otherwise, <b>false</b>.</returns>
2932
bool SupportsCaller(Type commandCaller);
3033

3134
/// <summary>
32-
/// Gets the associated command instance for the given context.
33-
/// Note that <see cref="ICommandContext.Command"/> might be null.
35+
/// Gets the associated command instance for the given context.
36+
/// Note that <see cref="ICommandContext.Command" /> might be null.
3437
/// </summary>
3538
/// <param name="context">The context of the command.</param>
36-
/// <returns>The associated <see cref="ICommand"/> instance of the context.</returns>
39+
/// <returns>The associated <see cref="ICommand" /> instance of the context.</returns>
3740
ICommand GetCommand(ICommandContext context);
3841
}
3942
}

0 commit comments

Comments
 (0)