Simplify return statements.
Remove redundant ‘this’. Remove unused using directives. Simplify LINQ chains. Add some trait property descriptions. Add readonly where viable. Add fullstops to some yaml descriptions.
This commit is contained in:
@@ -15,8 +15,8 @@ namespace OpenRA
|
||||
{
|
||||
public class Group
|
||||
{
|
||||
Actor[] actors;
|
||||
int id;
|
||||
readonly Actor[] actors;
|
||||
readonly int id;
|
||||
|
||||
static int nextGroup;
|
||||
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace OpenRA.Traits
|
||||
|
||||
public class CreatesShroud : ITick, ISync
|
||||
{
|
||||
CreatesShroudInfo info;
|
||||
readonly CreatesShroudInfo info;
|
||||
[Sync] CPos cachedLocation;
|
||||
[Sync] bool cachedDisabled;
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace OpenRA.Traits
|
||||
|
||||
public class DebugPauseState : ISync
|
||||
{
|
||||
World world;
|
||||
readonly World world;
|
||||
[Sync] public bool Paused { get { return world.Paused; } }
|
||||
public DebugPauseState(World world) { this.world = world; }
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace OpenRA.Traits
|
||||
|
||||
public void SetTarget(Actor self, Target target, Color c, bool display)
|
||||
{
|
||||
this.targets = new List<Target> { target };
|
||||
targets = new List<Target> { target };
|
||||
this.c = c;
|
||||
|
||||
if (display)
|
||||
|
||||
@@ -110,7 +110,7 @@ namespace OpenRA.Traits
|
||||
if (IsDead)
|
||||
return;
|
||||
|
||||
var oldState = this.DamageState;
|
||||
var oldState = DamageState;
|
||||
|
||||
// Apply any damage modifiers
|
||||
if (!ignoreModifiers && damage > 0)
|
||||
@@ -128,7 +128,7 @@ namespace OpenRA.Traits
|
||||
{
|
||||
Attacker = attacker,
|
||||
Damage = damage,
|
||||
DamageState = this.DamageState,
|
||||
DamageState = DamageState,
|
||||
PreviousDamageState = oldState,
|
||||
Warhead = warhead,
|
||||
};
|
||||
|
||||
@@ -12,7 +12,7 @@ using System;
|
||||
|
||||
namespace OpenRA.Traits
|
||||
{
|
||||
/* attributes used by RALint to understand the rules */
|
||||
/* attributes used by OpenRA.Lint to understand the rules */
|
||||
|
||||
[AttributeUsage(AttributeTargets.Field)]
|
||||
public sealed class ActorReferenceAttribute : Attribute { }
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace OpenRA.Traits
|
||||
|
||||
public class RevealsShroud : ITick, ISync
|
||||
{
|
||||
RevealsShroudInfo info;
|
||||
readonly RevealsShroudInfo info;
|
||||
[Sync] CPos cachedLocation;
|
||||
|
||||
public RevealsShroud(RevealsShroudInfo info)
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace OpenRA.Traits
|
||||
public class Selectable : IPostRenderSelection
|
||||
{
|
||||
public SelectableInfo Info;
|
||||
Actor self;
|
||||
readonly Actor self;
|
||||
|
||||
public Selectable(Actor self, SelectableInfo info)
|
||||
{
|
||||
|
||||
@@ -28,7 +28,7 @@ namespace OpenRA.Traits
|
||||
static readonly string[] TagStrings = { "", "tag-fake", "tag-primary" };
|
||||
|
||||
public SelectionDecorationsInfo Info;
|
||||
Actor self;
|
||||
readonly Actor self;
|
||||
|
||||
public SelectionDecorations(Actor self, SelectionDecorationsInfo info)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user