StyleCop clean OpenRA.Game
This commit is contained in:
@@ -23,7 +23,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Amount of Z axis changes in world units.")]
|
||||
public readonly int OffsetModifier = -43;
|
||||
|
||||
public object Create(ActorInitializer init) { return new Hovers(this, init.self); }
|
||||
public object Create(ActorInitializer init) { return new Hovers(this, init.Self); }
|
||||
}
|
||||
|
||||
class Hovers : IRenderModifier
|
||||
|
||||
@@ -41,9 +41,9 @@ namespace OpenRA.Mods.Common.Traits
|
||||
: this(init, info, () => 0) { }
|
||||
|
||||
public RenderBuilding(ActorInitializer init, RenderBuildingInfo info, Func<int> baseFacing)
|
||||
: base(init.self, baseFacing)
|
||||
: base(init.Self, baseFacing)
|
||||
{
|
||||
var self = init.self;
|
||||
var self = init.Self;
|
||||
this.info = info;
|
||||
|
||||
DefaultAnimation.PlayRepeating(NormalizeSequence(self, "idle"));
|
||||
|
||||
@@ -46,9 +46,9 @@ namespace OpenRA.Mods.Common.Traits
|
||||
}
|
||||
|
||||
public RenderBuildingTurreted(ActorInitializer init, RenderBuildingInfo info)
|
||||
: base(init, info, MakeTurretFacingFunc(init.self))
|
||||
: base(init, info, MakeTurretFacingFunc(init.Self))
|
||||
{
|
||||
t = init.self.TraitsImplementing<Turreted>().FirstOrDefault();
|
||||
t = init.Self.TraitsImplementing<Turreted>().FirstOrDefault();
|
||||
t.QuantizedFacings = DefaultAnimation.CurrentSequence.Facings;
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Invisible during games.")]
|
||||
class RenderEditorOnlyInfo : RenderSimpleInfo
|
||||
{
|
||||
public override object Create(ActorInitializer init) { return new RenderEditorOnly(init.self); }
|
||||
public override object Create(ActorInitializer init) { return new RenderEditorOnly(init.Self); }
|
||||
}
|
||||
|
||||
class RenderEditorOnly : RenderSimple
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
class RenderFlareInfo : RenderSimpleInfo
|
||||
{
|
||||
public override object Create(ActorInitializer init) { return new RenderFlare(init.self); }
|
||||
public override object Create(ActorInitializer init) { return new RenderFlare(init.Self); }
|
||||
}
|
||||
|
||||
class RenderFlare : RenderSimple
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
public readonly string Font = "TinyBold";
|
||||
|
||||
public object Create(ActorInitializer init) { return new RenderNameTag(init.self, this); }
|
||||
public object Create(ActorInitializer init) { return new RenderNameTag(init.Self, this); }
|
||||
}
|
||||
|
||||
class RenderNameTag : IRender
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
public class RenderSimpleInfo : RenderSpritesInfo, IRenderActorPreviewSpritesInfo, IQuantizeBodyOrientationInfo, ILegacyEditorRenderInfo, Requires<IBodyOrientationInfo>
|
||||
{
|
||||
public override object Create(ActorInitializer init) { return new RenderSimple(init.self); }
|
||||
public override object Create(ActorInitializer init) { return new RenderSimple(init.Self); }
|
||||
|
||||
public virtual IEnumerable<IActorPreview> RenderPreviewSprites(ActorPreviewInitializer init, RenderSpritesInfo rs, string image, int facings, PaletteReference p)
|
||||
{
|
||||
|
||||
@@ -32,7 +32,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Change the sprite image size.")]
|
||||
public readonly float Scale = 1f;
|
||||
|
||||
public virtual object Create(ActorInitializer init) { return new RenderSprites(init.self); }
|
||||
public virtual object Create(ActorInitializer init) { return new RenderSprites(init.Self); }
|
||||
|
||||
public IEnumerable<IActorPreview> RenderPreview(ActorPreviewInitializer init)
|
||||
{
|
||||
@@ -200,7 +200,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
return anims.Values.Where(b => b.IsVisible
|
||||
&& b.Animation.Animation.CurrentSequence != null)
|
||||
.Select(a => (a.Animation.Animation.Image.size * info.Scale).ToInt2())
|
||||
.Select(a => (a.Animation.Animation.Image.Size * info.Scale).ToInt2())
|
||||
.FirstOrDefault();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
public class RenderUnitInfo : RenderSimpleInfo, Requires<IFacingInfo>
|
||||
{
|
||||
public override object Create(ActorInitializer init) { return new RenderUnit(init.self); }
|
||||
public override object Create(ActorInitializer init) { return new RenderUnit(init.Self); }
|
||||
}
|
||||
|
||||
public class RenderUnit : RenderSimple
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
public readonly Color Color = Color.Red;
|
||||
|
||||
public object Create(ActorInitializer init) { return new TimedUpgradeBar(init.self, this); }
|
||||
public object Create(ActorInitializer init) { return new TimedUpgradeBar(init.Self, this); }
|
||||
}
|
||||
|
||||
class TimedUpgradeBar : ISelectionBar
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Visual offset")]
|
||||
public readonly WVec LocalOffset = WVec.Zero;
|
||||
|
||||
public object Create(ActorInitializer init) { return new WithBarrel(init.self, this); }
|
||||
public object Create(ActorInitializer init) { return new WithBarrel(init.Self, this); }
|
||||
|
||||
public IEnumerable<IActorPreview> RenderPreviewSprites(ActorPreviewInitializer init, RenderSpritesInfo rs, string image, int facings, PaletteReference p)
|
||||
{
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Sequence name to use")]
|
||||
public readonly string Sequence = "build";
|
||||
|
||||
public object Create(ActorInitializer init) { return new WithBuildingPlacedAnimation(init.self, this); }
|
||||
public object Create(ActorInitializer init) { return new WithBuildingPlacedAnimation(init.Self, this); }
|
||||
}
|
||||
|
||||
public class WithBuildingPlacedAnimation : INotifyBuildingPlaced
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Easteregg sequences to use in december.")]
|
||||
public readonly string[] XmasImages = { };
|
||||
|
||||
public object Create(ActorInitializer init) { return new WithCrateBody(init.self, this); }
|
||||
public object Create(ActorInitializer init) { return new WithCrateBody(init.Self, this); }
|
||||
}
|
||||
|
||||
class WithCrateBody : INotifyParachuteLanded
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Custom crushed animation palette is a player palette BaseName")]
|
||||
public readonly bool CrushedPaletteIsPlayerPalette = false;
|
||||
|
||||
public object Create(ActorInitializer init) { return new WithDeathAnimation(init.self, this); }
|
||||
public object Create(ActorInitializer init) { return new WithDeathAnimation(init.Self, this); }
|
||||
}
|
||||
|
||||
public class WithDeathAnimation : INotifyKilled
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Position relative to body")]
|
||||
public readonly WVec Offset = WVec.Zero;
|
||||
|
||||
public object Create(ActorInitializer init) { return new WithHarvestAnimation(init.self, this); }
|
||||
public object Create(ActorInitializer init) { return new WithHarvestAnimation(init.Self, this); }
|
||||
}
|
||||
|
||||
class WithHarvestAnimation : INotifyHarvesterAction
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public WithMakeAnimation(ActorInitializer init, WithMakeAnimationInfo info)
|
||||
{
|
||||
this.info = info;
|
||||
var self = init.self;
|
||||
var self = init.Self;
|
||||
renderBuilding = self.Trait<RenderBuilding>();
|
||||
|
||||
var building = self.Trait<Building>();
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Ignore the weapon position, and always draw relative to the center of the actor")]
|
||||
public readonly bool IgnoreOffset = false;
|
||||
|
||||
public object Create(ActorInitializer init) { return new WithMuzzleFlash(init.self, this); }
|
||||
public object Create(ActorInitializer init) { return new WithMuzzleFlash(init.Self, this); }
|
||||
}
|
||||
|
||||
class WithMuzzleFlash : INotifyAttack, IRender, ITick
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Sequence name to use")]
|
||||
public readonly string Sequence = "resources";
|
||||
|
||||
public object Create(ActorInitializer init) { return new WithResources(init.self, this); }
|
||||
public object Create(ActorInitializer init) { return new WithResources(init.Self, this); }
|
||||
}
|
||||
|
||||
class WithResources : INotifyBuildComplete, INotifySold, INotifyOwnerChanged, INotifyDamageStateChanged
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Change this when using this trait multiple times on the same actor.")]
|
||||
public readonly string Id = "rotor";
|
||||
|
||||
public object Create(ActorInitializer init) { return new WithRotor(init.self, this); }
|
||||
public object Create(ActorInitializer init) { return new WithRotor(init.Self, this); }
|
||||
|
||||
public IEnumerable<IActorPreview> RenderPreviewSprites(ActorPreviewInitializer init, RenderSpritesInfo rs, string image, int facings, PaletteReference p)
|
||||
{
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Needs to define \"idle\", \"loop\" and \"end\" sub-sequences.")]
|
||||
public readonly string Sequence = "smoke_m";
|
||||
|
||||
public object Create(ActorInitializer init) { return new WithSmoke(init.self, this); }
|
||||
public object Create(ActorInitializer init) { return new WithSmoke(init.Self, this); }
|
||||
}
|
||||
|
||||
public class WithSmoke : INotifyDamage
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Render recoil")]
|
||||
public readonly bool Recoils = true;
|
||||
|
||||
public object Create(ActorInitializer init) { return new WithTurret(init.self, this); }
|
||||
public object Create(ActorInitializer init) { return new WithTurret(init.Self, this); }
|
||||
|
||||
public IEnumerable<IActorPreview> RenderPreviewSprites(ActorPreviewInitializer init, RenderSpritesInfo rs, string image, int facings, PaletteReference p)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user