StyleCop clean OpenRA.Game
This commit is contained in:
@@ -25,7 +25,7 @@ namespace OpenRA.Mods.D2k.Traits
|
||||
|
||||
public readonly string WormAttackNotification = "WormAttack";
|
||||
|
||||
public override object Create(ActorInitializer init) { return new AttackSwallow(init.self, this); }
|
||||
public override object Create(ActorInitializer init) { return new AttackSwallow(init.Self, this); }
|
||||
}
|
||||
|
||||
class AttackSwallow : AttackFrontal
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace OpenRA.Mods.D2k.Traits
|
||||
[Desc("Automatically transports harvesters with the Carryable trait between resource fields and refineries")]
|
||||
public class AutoCarryallInfo : ITraitInfo, Requires<IBodyOrientationInfo>
|
||||
{
|
||||
public object Create(ActorInitializer init) { return new AutoCarryall(init.self, this); }
|
||||
public object Create(ActorInitializer init) { return new AutoCarryall(init.Self, this); }
|
||||
}
|
||||
|
||||
public class AutoCarryall : INotifyBecomingIdle, INotifyKilled, ISync, IRender
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace OpenRA.Mods.D2k.Traits
|
||||
public readonly string[] SafeTerrain = { "Concrete" };
|
||||
public readonly int DamageThreshold = 50;
|
||||
|
||||
public object Create(ActorInitializer init) { return new DamagedWithoutFoundation(init.self, this); }
|
||||
public object Create(ActorInitializer init) { return new DamagedWithoutFoundation(init.Self, this); }
|
||||
}
|
||||
|
||||
class DamagedWithoutFoundation : ITick, ISync, INotifyAddedToWorld
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace OpenRA.Mods.D2k.Traits
|
||||
[Desc("Offset relative to the actor TopLeft. Not used if the template is PickAny")]
|
||||
public readonly CVec Offset = CVec.Zero;
|
||||
|
||||
public object Create(ActorInitializer init) { return new LaysTerrain(init.self, this); }
|
||||
public object Create(ActorInitializer init) { return new LaysTerrain(init.Self, this); }
|
||||
}
|
||||
|
||||
public class LaysTerrain : INotifyAddedToWorld
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace OpenRA.Mods.D2k.Traits
|
||||
[Desc("Required distance away from destination before requesting a pickup.")]
|
||||
public int MinDistance = 6;
|
||||
|
||||
public object Create(ActorInitializer init) { return new Carryable(init.self, this); }
|
||||
public object Create(ActorInitializer init) { return new Carryable(init.Self, this); }
|
||||
}
|
||||
|
||||
public class Carryable : IDisableMove, INotifyHarvesterAction
|
||||
|
||||
@@ -43,9 +43,9 @@ namespace OpenRA.Mods.D2k.Traits
|
||||
{
|
||||
this.info = info;
|
||||
|
||||
renderSprites = init.self.Trait<RenderSprites>();
|
||||
renderSprites = init.Self.Trait<RenderSprites>();
|
||||
|
||||
overlay = new Animation(init.world, renderSprites.GetImage(init.self));
|
||||
overlay = new Animation(init.World, renderSprites.GetImage(init.Self));
|
||||
|
||||
var key = "attack_overlay_{0}".F(info.Sequence);
|
||||
renderSprites.Add(key, new AnimationWithOffset(overlay, null, () => !attacking),
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace OpenRA.Mods.D2k.Traits
|
||||
[Desc("Custom palette is a player palette BaseName")]
|
||||
public readonly bool IsPlayerPalette = false;
|
||||
|
||||
public object Create(ActorInitializer init) { return new WithBuildingPlacedOverlay(init.self, this); }
|
||||
public object Create(ActorInitializer init) { return new WithBuildingPlacedOverlay(init.Self, this); }
|
||||
}
|
||||
|
||||
public class WithBuildingPlacedOverlay : INotifyBuildComplete, INotifySold, INotifyDamageStateChanged, INotifyBuildingPlaced
|
||||
|
||||
@@ -40,12 +40,12 @@ namespace OpenRA.Mods.D2k.Traits
|
||||
return;
|
||||
|
||||
var key = "make_overlay_{0}".F(info.Sequence);
|
||||
var rs = init.self.Trait<RenderSprites>();
|
||||
var rs = init.Self.Trait<RenderSprites>();
|
||||
|
||||
var overlay = new Animation(init.world, rs.GetImage(init.self));
|
||||
var overlay = new Animation(init.World, rs.GetImage(init.Self));
|
||||
|
||||
// Remove the animation once it is complete
|
||||
overlay.PlayThen(info.Sequence, () => init.world.AddFrameEndTask(w => rs.Remove(key)));
|
||||
overlay.PlayThen(info.Sequence, () => init.World.AddFrameEndTask(w => rs.Remove(key)));
|
||||
|
||||
rs.Add(key, new AnimationWithOffset(overlay, null, () => !buildComplete),
|
||||
info.Palette, info.IsPlayerPalette);
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace OpenRA.Mods.D2k.Traits
|
||||
[Desc("Custom palette is a player palette BaseName")]
|
||||
public readonly bool IsPlayerPalette = false;
|
||||
|
||||
public object Create(ActorInitializer init) { return new WithDeliveryOverlay(init.self, this); }
|
||||
public object Create(ActorInitializer init) { return new WithDeliveryOverlay(init.Self, this); }
|
||||
}
|
||||
|
||||
public class WithDeliveryOverlay : INotifyBuildComplete, INotifySold, INotifyDelivery
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace OpenRA.Mods.D2k.Traits
|
||||
[Desc("Custom palette is a player palette BaseName")]
|
||||
public readonly bool IsPlayerPalette = false;
|
||||
|
||||
public object Create(ActorInitializer init) { return new WithDockingOverlay(init.self, this); }
|
||||
public object Create(ActorInitializer init) { return new WithDockingOverlay(init.Self, this); }
|
||||
}
|
||||
|
||||
public class WithDockingOverlay : INotifyDocking, INotifyBuildComplete, INotifySold
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace OpenRA.Mods.D2k.Traits
|
||||
[Desc("Custom palette is a player palette BaseName")]
|
||||
public readonly bool IsPlayerPalette = false;
|
||||
|
||||
public object Create(ActorInitializer init) { return new WithProductionOverlay(init.self, this); }
|
||||
public object Create(ActorInitializer init) { return new WithProductionOverlay(init.Self, this); }
|
||||
}
|
||||
|
||||
public class WithProductionOverlay : INotifyDamageStateChanged, ITick, INotifyBuildComplete, INotifySold
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace OpenRA.Mods.D2k.Traits
|
||||
{
|
||||
public readonly Color BarColor = Color.Orange;
|
||||
|
||||
public object Create(ActorInitializer init) { return new TemporaryOwnerManager(init.self, this); }
|
||||
public object Create(ActorInitializer init) { return new TemporaryOwnerManager(init.Self, this); }
|
||||
}
|
||||
|
||||
public class TemporaryOwnerManager : ISelectionBar, ITick, ISync, INotifyOwnerChanged
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace OpenRA.Mods.D2k.Traits
|
||||
|
||||
// Terrain tiles define their origin at the topleft
|
||||
var s = theater.TileSprite(tile);
|
||||
dirty[cell] = new Sprite(s.sheet, s.bounds, float2.Zero, s.channel, s.blendMode);
|
||||
dirty[cell] = new Sprite(s.Sheet, s.Bounds, float2.Zero, s.Channel, s.BlendMode);
|
||||
}
|
||||
|
||||
public void TickRender(WorldRenderer wr, Actor self)
|
||||
@@ -67,10 +67,10 @@ namespace OpenRA.Mods.D2k.Traits
|
||||
if (!wr.Viewport.VisibleCells.Contains(kv.Key))
|
||||
continue;
|
||||
|
||||
if (wr.world.ShroudObscures(kv.Key))
|
||||
if (wr.World.ShroudObscures(kv.Key))
|
||||
continue;
|
||||
|
||||
new SpriteRenderable(kv.Value, wr.world.Map.CenterOfCell(kv.Key),
|
||||
new SpriteRenderable(kv.Value, wr.World.Map.CenterOfCell(kv.Key),
|
||||
WVec.Zero, -511, pal, 1f, true).Render(wr);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace OpenRA.Mods.D2k.Traits
|
||||
|
||||
public ChooseBuildTabOnSelect(ActorInitializer init, ChooseBuildTabOnSelectInfo info)
|
||||
{
|
||||
world = init.world;
|
||||
world = init.World;
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace OpenRA.Mods.D2k.Traits
|
||||
public readonly string WormSignature = "sandworm";
|
||||
public readonly string WormOwnerPlayer = "Creeps";
|
||||
|
||||
public object Create(ActorInitializer init) { return new WormManager(this, init.self); }
|
||||
public object Create(ActorInitializer init) { return new WormManager(this, init.Self); }
|
||||
}
|
||||
|
||||
class WormManager : ITick
|
||||
|
||||
Reference in New Issue
Block a user