Ensure editorconfig naming styles align with StyleCop SA13XX style rules.
Aligns the naming conventions defined in editorconfig (dotnet_naming_style, dotnet_naming_symbols, dotnet_naming_rule) which are reported under the IDE1006 rule with the existing StyleCop rules from the SA13XX range. This ensures the two rulesets agree when rejecting and accepting naming conventions within the IDE, with a few edges cases where only one ruleset can enforce the convention. IDE1006 allows use to specify a naming convention for type parameters, const locals and protected readonly fields which SA13XX cannot enforce. Some StyleCop SA13XX rules such as SA1309 'Field names should not begin with underscore' are not possible to enforce with the naming rules of IDE1006. Therefore we enable the IDE1006 as a build time warning to enforce conventions and extend them. We disable SA13XX rules that can now be covered by IDE1006 to avoid double-reporting but leave the remaining SA13XX rules that cover additional cases enabled. We also re-enable the SA1311 rule convention but enforce it via IDE1006, requiring some violations to be fixed or duplication of existing suppressions. Most violations fixes are trivial renames with the following exception. In ActorInitializer.cs, we prefer to make the fields private instead. ValueActorInit provides a publicly accessible property for access and OwnerInit provides a publicly accessible method. Health.cs is adjusted to access the property base instead when overriding. The reflection calls must be adjusted to target the base class specifically, as searching for a private field from the derived class will fail to locate it on the base class. Unused suppressions were removed.
This commit is contained in:
@@ -16,29 +16,29 @@ namespace OpenRA.Platforms.Default
|
||||
{
|
||||
static class MultiTapDetection
|
||||
{
|
||||
static readonly Cache<(Keycode Key, Modifiers Mods), TapHistory> keyHistoryCache =
|
||||
static readonly Cache<(Keycode Key, Modifiers Mods), TapHistory> KeyHistoryCache =
|
||||
new Cache<(Keycode, Modifiers), TapHistory>(_ => new TapHistory(DateTime.Now - TimeSpan.FromSeconds(1)));
|
||||
static readonly Cache<byte, TapHistory> clickHistoryCache =
|
||||
static readonly Cache<byte, TapHistory> ClickHistoryCache =
|
||||
new Cache<byte, TapHistory>(_ => new TapHistory(DateTime.Now - TimeSpan.FromSeconds(1)));
|
||||
|
||||
public static int DetectFromMouse(byte button, int2 xy)
|
||||
{
|
||||
return clickHistoryCache[button].GetTapCount(xy);
|
||||
return ClickHistoryCache[button].GetTapCount(xy);
|
||||
}
|
||||
|
||||
public static int InfoFromMouse(byte button)
|
||||
{
|
||||
return clickHistoryCache[button].LastTapCount();
|
||||
return ClickHistoryCache[button].LastTapCount();
|
||||
}
|
||||
|
||||
public static int DetectFromKeyboard(Keycode key, Modifiers mods)
|
||||
{
|
||||
return keyHistoryCache[(key, mods)].GetTapCount(int2.Zero);
|
||||
return KeyHistoryCache[(key, mods)].GetTapCount(int2.Zero);
|
||||
}
|
||||
|
||||
public static int InfoFromKeyboard(Keycode key, Modifiers mods)
|
||||
{
|
||||
return keyHistoryCache[(key, mods)].LastTapCount();
|
||||
return KeyHistoryCache[(key, mods)].LastTapCount();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user