StyleCop clean OpenRA.Game
This commit is contained in:
@@ -17,7 +17,7 @@ namespace OpenRA.Mods.RA.Traits
|
||||
public class TargetableAircraftInfo : TargetableUnitInfo
|
||||
{
|
||||
public readonly string[] GroundedTargetTypes = { };
|
||||
public override object Create(ActorInitializer init) { return new TargetableAircraft(init.self, this); }
|
||||
public override object Create(ActorInitializer init) { return new TargetableAircraft(init.Self, this); }
|
||||
}
|
||||
|
||||
public class TargetableAircraft : TargetableUnit
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace OpenRA.Mods.RA.Traits
|
||||
|
||||
public readonly string MuzzlePalette = "effect";
|
||||
|
||||
public override object Create(ActorInitializer init) { return new AttackGarrisoned(init.self, this); }
|
||||
public override object Create(ActorInitializer init) { return new AttackGarrisoned(init.Self, this); }
|
||||
}
|
||||
|
||||
public class AttackGarrisoned : AttackFollow, INotifyPassengerEntered, INotifyPassengerExited, IRender
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace OpenRA.Mods.RA.Traits
|
||||
public readonly WRange Speed = new WRange(426);
|
||||
public readonly WAngle Angle = WAngle.FromDegrees(20);
|
||||
|
||||
public override object Create(ActorInitializer init) { return new AttackLeap(init.self, this); }
|
||||
public override object Create(ActorInitializer init) { return new AttackLeap(init.Self, this); }
|
||||
}
|
||||
|
||||
class AttackLeap : AttackFrontal, ISync
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace OpenRA.Mods.RA.Traits
|
||||
[Desc("The name of the weapon to use when demolishing the bridge")]
|
||||
public readonly string DemolishWeapon = "Demolish";
|
||||
|
||||
public object Create(ActorInitializer init) { return new Bridge(init.self, this); }
|
||||
public object Create(ActorInitializer init) { return new Bridge(init.Self, this); }
|
||||
|
||||
public IEnumerable<Pair<ushort, float>> Templates
|
||||
{
|
||||
@@ -179,7 +179,7 @@ namespace OpenRA.Mods.RA.Traits
|
||||
|
||||
return footprint.Select(c => (IRenderable)(new SpriteRenderable(
|
||||
wr.Theater.TileSprite(new TerrainTile(template, c.Value)),
|
||||
wr.world.Map.CenterOfCell(c.Key), WVec.Zero, -offset, palette, 1f, true))).ToArray();
|
||||
wr.World.Map.CenterOfCell(c.Key), WVec.Zero, -offset, palette, 1f, true))).ToArray();
|
||||
}
|
||||
|
||||
bool initialized;
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace OpenRA.Mods.RA.Traits
|
||||
[Desc("Uses the \"Cloneable\" trait to determine whether or not we should clone a produced unit.")]
|
||||
public readonly string[] CloneableTypes = { };
|
||||
|
||||
public object Create(ActorInitializer init) { return new ClonesProducedUnits(init.self, this); }
|
||||
public object Create(ActorInitializer init) { return new ClonesProducedUnits(init.Self, this); }
|
||||
}
|
||||
|
||||
public class ClonesProducedUnits : INotifyOtherProduction
|
||||
|
||||
@@ -31,7 +31,7 @@ namespace OpenRA.Mods.RA.Traits
|
||||
[Desc("Actually harvester facing when docking, 0-255 counter-clock-wise.")]
|
||||
public readonly int DockAngle = 64;
|
||||
|
||||
public virtual object Create(ActorInitializer init) { return new OreRefinery(init.self, this); }
|
||||
public virtual object Create(ActorInitializer init) { return new OreRefinery(init.Self, this); }
|
||||
}
|
||||
|
||||
public class OreRefinery : ITick, IAcceptOre, INotifyKilled, INotifySold, INotifyCapture, INotifyOwnerChanged, IExplodeModifier, ISync
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace OpenRA.Mods.RA.Traits
|
||||
|
||||
public readonly string IndicatorPalettePrefix = "player";
|
||||
|
||||
public object Create(ActorInitializer init) { return new RepairableBuilding(init.self, this); }
|
||||
public object Create(ActorInitializer init) { return new RepairableBuilding(init.Self, this); }
|
||||
}
|
||||
|
||||
public class RepairableBuilding : UpgradableTrait<RepairableBuildingInfo>, ITick
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace OpenRA.Mods.RA.Traits
|
||||
|
||||
public bool RequiresForceFire = false;
|
||||
|
||||
public object Create(ActorInitializer init) { return new TargetableBuilding(init.self, this); }
|
||||
public object Create(ActorInitializer init) { return new TargetableBuilding(init.Self, this); }
|
||||
}
|
||||
|
||||
public class TargetableBuilding : ITargetable
|
||||
|
||||
@@ -42,7 +42,7 @@ namespace OpenRA.Mods.RA.Traits
|
||||
|
||||
public Crate(ActorInitializer init, CrateInfo info)
|
||||
{
|
||||
this.self = init.self;
|
||||
this.self = init.Self;
|
||||
this.info = info;
|
||||
|
||||
if (init.Contains<LocationInit>())
|
||||
|
||||
@@ -38,7 +38,7 @@ namespace OpenRA.Mods.RA.Traits
|
||||
[Desc("Actor types that this crate action will not occur for.")]
|
||||
[ActorReference] public string[] ExcludedActorTypes = { };
|
||||
|
||||
public virtual object Create(ActorInitializer init) { return new CrateAction(init.self, this); }
|
||||
public virtual object Create(ActorInitializer init) { return new CrateAction(init.Self, this); }
|
||||
}
|
||||
|
||||
public class CrateAction
|
||||
|
||||
@@ -41,7 +41,7 @@ namespace OpenRA.Mods.RA.Traits
|
||||
[Desc("Is the new duplicates given to a specific owner, regardless of whom collected it?")]
|
||||
public readonly string Owner = null;
|
||||
|
||||
public override object Create(ActorInitializer init) { return new DuplicateUnitCrateAction(init.self, this); }
|
||||
public override object Create(ActorInitializer init) { return new DuplicateUnitCrateAction(init.Self, this); }
|
||||
}
|
||||
|
||||
class DuplicateUnitCrateAction : CrateAction
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace OpenRA.Mods.RA.Traits
|
||||
[Desc("The weapon to fire upon collection.")]
|
||||
[WeaponReference] public string Weapon = null;
|
||||
|
||||
public override object Create(ActorInitializer init) { return new ExplodeCrateAction(init.self, this); }
|
||||
public override object Create(ActorInitializer init) { return new ExplodeCrateAction(init.Self, this); }
|
||||
}
|
||||
|
||||
class ExplodeCrateAction : CrateAction
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace OpenRA.Mods.RA.Traits
|
||||
[Desc("Should the collected amount be displayed as a cash tick?")]
|
||||
public bool UseCashTick = false;
|
||||
|
||||
public override object Create(ActorInitializer init) { return new GiveCashCrateAction(init.self, this); }
|
||||
public override object Create(ActorInitializer init) { return new GiveCashCrateAction(init.Self, this); }
|
||||
}
|
||||
|
||||
class GiveCashCrateAction : CrateAction
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace OpenRA.Mods.RA.Traits
|
||||
[Desc("The selection shares to use if the collector has no base.")]
|
||||
public int NoBaseSelectionShares = 1000;
|
||||
|
||||
public override object Create(ActorInitializer init) { return new GiveMcvCrateAction(init.self, this); }
|
||||
public override object Create(ActorInitializer init) { return new GiveMcvCrateAction(init.Self, this); }
|
||||
}
|
||||
|
||||
class GiveMcvCrateAction : GiveUnitCrateAction
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace OpenRA.Mods.RA.Traits
|
||||
[Desc("Override the owner of the newly spawned unit: e.g. Creeps or Neutral")]
|
||||
public readonly string Owner = null;
|
||||
|
||||
public override object Create(ActorInitializer init) { return new GiveUnitCrateAction(init.self, this); }
|
||||
public override object Create(ActorInitializer init) { return new GiveUnitCrateAction(init.Self, this); }
|
||||
}
|
||||
|
||||
class GiveUnitCrateAction : CrateAction
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace OpenRA.Mods.RA.Traits
|
||||
[Desc("The maximum number of extra collectors to grant the crate action to.", "-1 = no limit")]
|
||||
public readonly int MaxExtraCollectors = 4;
|
||||
|
||||
public override object Create(ActorInitializer init) { return new GrantUpgradeCrateAction(init.self, this); }
|
||||
public override object Create(ActorInitializer init) { return new GrantUpgradeCrateAction(init.Self, this); }
|
||||
}
|
||||
|
||||
public class GrantUpgradeCrateAction : CrateAction
|
||||
|
||||
@@ -16,7 +16,7 @@ namespace OpenRA.Mods.RA.Traits
|
||||
[Desc("Heals all actors that belong to the owner of the collector.")]
|
||||
class HealUnitsCrateActionInfo : CrateActionInfo
|
||||
{
|
||||
public override object Create(ActorInitializer init) { return new HealUnitsCrateAction(init.self, this); }
|
||||
public override object Create(ActorInitializer init) { return new HealUnitsCrateAction(init.Self, this); }
|
||||
}
|
||||
|
||||
class HealUnitsCrateAction : CrateAction
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace OpenRA.Mods.RA.Traits
|
||||
[Desc("Hides the entire map in shroud.")]
|
||||
class HideMapCrateActionInfo : CrateActionInfo
|
||||
{
|
||||
public override object Create(ActorInitializer init) { return new HideMapCrateAction(init.self, this); }
|
||||
public override object Create(ActorInitializer init) { return new HideMapCrateAction(init.Self, this); }
|
||||
}
|
||||
|
||||
class HideMapCrateAction : CrateAction
|
||||
|
||||
@@ -25,7 +25,7 @@ namespace OpenRA.Mods.RA.Traits
|
||||
[Desc("The maximum number of extra collectors to grant the crate action to.")]
|
||||
public readonly int MaxExtraCollectors = 4;
|
||||
|
||||
public override object Create(ActorInitializer init) { return new LevelUpCrateAction(init.self, this); }
|
||||
public override object Create(ActorInitializer init) { return new LevelUpCrateAction(init.Self, this); }
|
||||
}
|
||||
|
||||
class LevelUpCrateAction : CrateAction
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace OpenRA.Mods.RA.Traits
|
||||
[Desc("Should the map also be revealed for the allies of the collector's owner.")]
|
||||
public readonly bool IncludeAllies = false;
|
||||
|
||||
public override object Create(ActorInitializer init) { return new RevealMapCrateAction(init.self, this); }
|
||||
public override object Create(ActorInitializer init) { return new RevealMapCrateAction(init.Self, this); }
|
||||
}
|
||||
|
||||
class RevealMapCrateAction : CrateAction
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace OpenRA.Mods.RA.Traits
|
||||
[Desc("Which proxy actor, which grants the support power, to spawn.")]
|
||||
[ActorReference] public readonly string Proxy = null;
|
||||
|
||||
public override object Create(ActorInitializer init) { return new SupportPowerCrateAction(init.self, this); }
|
||||
public override object Create(ActorInitializer init) { return new SupportPowerCrateAction(init.Self, this); }
|
||||
}
|
||||
|
||||
class SupportPowerCrateAction : CrateAction
|
||||
|
||||
@@ -40,7 +40,7 @@ namespace OpenRA.Mods.RA.Traits
|
||||
[Desc("Search radius (in cells) from the last harvest order location to find more resources.")]
|
||||
public readonly int SearchFromOrderRadius = 12;
|
||||
|
||||
public object Create(ActorInitializer init) { return new Harvester(init.self, this); }
|
||||
public object Create(ActorInitializer init) { return new Harvester(init.Self, this); }
|
||||
}
|
||||
|
||||
public class Harvester : IIssueOrder, IResolveOrder, IPips,
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace OpenRA.Mods.RA.Traits
|
||||
{
|
||||
public readonly int Duration = 25 * 30;
|
||||
|
||||
public object Create(ActorInitializer init) { return new InfiltrateForPowerOutage(init.self, this); }
|
||||
public object Create(ActorInitializer init) { return new InfiltrateForPowerOutage(init.Self, this); }
|
||||
}
|
||||
|
||||
class InfiltrateForPowerOutage : INotifyOwnerChanged, INotifyInfiltrated
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace OpenRA.Mods.RA.Traits
|
||||
{
|
||||
this.info = info;
|
||||
|
||||
race = init.Contains<RaceInit>() ? init.Get<RaceInit, string>() : init.self.Owner.Country.Race;
|
||||
race = init.Contains<RaceInit>() ? init.Get<RaceInit, string>() : init.Self.Owner.Country.Race;
|
||||
}
|
||||
|
||||
public void Killed(Actor self, AttackInfo e)
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace OpenRA.Mods.RA.Traits
|
||||
[ActorReference]
|
||||
public readonly string DriverActor = "e1";
|
||||
|
||||
public object Create(ActorInitializer init) { return new MadTank(init.self, this); }
|
||||
public object Create(ActorInitializer init) { return new MadTank(init.Self, this); }
|
||||
}
|
||||
|
||||
class MadTank : IIssueOrder, IResolveOrder, IOrderVoice, ITick, IPreventsTeleport
|
||||
|
||||
@@ -30,7 +30,7 @@ namespace OpenRA.Mods.RA.Traits
|
||||
|
||||
public Mine(ActorInitializer init, MineInfo info)
|
||||
{
|
||||
this.self = init.self;
|
||||
this.self = init.Self;
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace OpenRA.Mods.RA.Traits
|
||||
|
||||
public readonly float MinefieldDepth = 1.5f;
|
||||
|
||||
public object Create(ActorInitializer init) { return new Minelayer(init.self); }
|
||||
public object Create(ActorInitializer init) { return new Minelayer(init.Self); }
|
||||
}
|
||||
|
||||
class Minelayer : IIssueOrder, IResolveOrder, IPostRenderSelection, ISync
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace OpenRA.Mods.RA.Traits
|
||||
public readonly string ResourceType = "Ore";
|
||||
public readonly int MaxRange = 100;
|
||||
|
||||
public object Create(ActorInitializer init) { return new SeedsResource(init.self, this); }
|
||||
public object Create(ActorInitializer init) { return new SeedsResource(init.Self, this); }
|
||||
}
|
||||
|
||||
class SeedsResource : ITick, ISeedableResource
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace OpenRA.Mods.RA.Traits
|
||||
public readonly int Duration = 30;
|
||||
public readonly bool KillCargo = true;
|
||||
|
||||
public override object Create(ActorInitializer init) { return new ChronoshiftPower(init.self, this); }
|
||||
public override object Create(ActorInitializer init) { return new ChronoshiftPower(init.Self, this); }
|
||||
}
|
||||
|
||||
class ChronoshiftPower : SupportPower
|
||||
@@ -139,7 +139,7 @@ namespace OpenRA.Mods.RA.Traits
|
||||
var tiles = world.Map.FindTilesInCircle(xy, range);
|
||||
var pal = wr.Palette("terrain");
|
||||
foreach (var t in tiles)
|
||||
yield return new SpriteRenderable(tile, wr.world.Map.CenterOfCell(t), WVec.Zero, -511, pal, 1f, true);
|
||||
yield return new SpriteRenderable(tile, wr.World.Map.CenterOfCell(t), WVec.Zero, -511, pal, 1f, true);
|
||||
}
|
||||
|
||||
public string GetCursor(World world, CPos xy, MouseInput mi)
|
||||
@@ -220,11 +220,11 @@ namespace OpenRA.Mods.RA.Traits
|
||||
|
||||
// Source tiles
|
||||
foreach (var t in world.Map.FindTilesInCircle(sourceLocation, range))
|
||||
yield return new SpriteRenderable(sourceTile, wr.world.Map.CenterOfCell(t), WVec.Zero, -511, pal, 1f, true);
|
||||
yield return new SpriteRenderable(sourceTile, wr.World.Map.CenterOfCell(t), WVec.Zero, -511, pal, 1f, true);
|
||||
|
||||
// Destination tiles
|
||||
foreach (var t in world.Map.FindTilesInCircle(xy, range))
|
||||
yield return new SpriteRenderable(sourceTile, wr.world.Map.CenterOfCell(t), WVec.Zero, -511, pal, 1f, true);
|
||||
yield return new SpriteRenderable(sourceTile, wr.World.Map.CenterOfCell(t), WVec.Zero, -511, pal, 1f, true);
|
||||
|
||||
// Unit previews
|
||||
foreach (var unit in power.UnitsInRange(sourceLocation))
|
||||
@@ -244,7 +244,7 @@ namespace OpenRA.Mods.RA.Traits
|
||||
var canEnter = manager.self.Owner.Shroud.IsExplored(targetCell) &&
|
||||
unit.Trait<Chronoshiftable>().CanChronoshiftTo(unit, targetCell);
|
||||
var tile = canEnter ? validTile : invalidTile;
|
||||
yield return new SpriteRenderable(tile, wr.world.Map.CenterOfCell(targetCell), WVec.Zero, -511, pal, 1f, true);
|
||||
yield return new SpriteRenderable(tile, wr.World.Map.CenterOfCell(targetCell), WVec.Zero, -511, pal, 1f, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace OpenRA.Mods.RA.Traits
|
||||
[Desc("Required for GpsPower. Attach this to the player actor.")]
|
||||
class GpsWatcherInfo : ITraitInfo
|
||||
{
|
||||
public object Create(ActorInitializer init) { return new GpsWatcher(init.self.Owner); }
|
||||
public object Create(ActorInitializer init) { return new GpsWatcher(init.Self.Owner); }
|
||||
}
|
||||
|
||||
class GpsWatcher : ISync, IFogVisibilityModifier
|
||||
@@ -85,7 +85,7 @@ namespace OpenRA.Mods.RA.Traits
|
||||
{
|
||||
public readonly int RevealDelay = 0;
|
||||
|
||||
public override object Create(ActorInitializer init) { return new GpsPower(init.self, this); }
|
||||
public override object Create(ActorInitializer init) { return new GpsPower(init.Self, this); }
|
||||
}
|
||||
|
||||
class GpsPower : SupportPower, INotifyKilled, INotifyStanceChanged, INotifySold, INotifyOwnerChanged
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace OpenRA.Mods.RA.Traits
|
||||
{
|
||||
public readonly string[] CloakedTargetTypes = { };
|
||||
|
||||
public override object Create(ActorInitializer init) { return new TargetableSubmarine(init.self, this); }
|
||||
public override object Create(ActorInitializer init) { return new TargetableSubmarine(init.Self, this); }
|
||||
}
|
||||
|
||||
public class TargetableSubmarine : TargetableUnit
|
||||
|
||||
@@ -23,7 +23,7 @@ namespace OpenRA.Mods.RA.Traits
|
||||
|
||||
public bool RequiresForceFire = false;
|
||||
|
||||
public virtual object Create(ActorInitializer init) { return new TargetableUnit(init.self, this); }
|
||||
public virtual object Create(ActorInitializer init) { return new TargetableUnit(init.Self, this); }
|
||||
}
|
||||
|
||||
public class TargetableUnit : ITargetable
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace OpenRA.Mods.RA.Traits
|
||||
[ActorReference]
|
||||
public readonly string[] Bridges = { "bridge1", "bridge2" };
|
||||
|
||||
public object Create(ActorInitializer init) { return new BridgeLayer(init.self, this); }
|
||||
public object Create(ActorInitializer init) { return new BridgeLayer(init.Self, this); }
|
||||
}
|
||||
|
||||
class BridgeLayer : IWorldLoaded
|
||||
|
||||
Reference in New Issue
Block a user