StyleCop clean OpenRA.Game
This commit is contained in:
@@ -40,7 +40,7 @@ namespace OpenRA.Traits
|
||||
return new WRot(WAngle.Zero, WAngle.Zero, WAngle.FromFacing(facing));
|
||||
}
|
||||
|
||||
public object Create(ActorInitializer init) { return new BodyOrientation(init.self, this); }
|
||||
public object Create(ActorInitializer init) { return new BodyOrientation(init.Self, this); }
|
||||
}
|
||||
|
||||
public class BodyOrientation : IBodyOrientation
|
||||
|
||||
@@ -13,7 +13,7 @@ namespace OpenRA.Traits
|
||||
[Desc("Checks for pause related desyncs. Attach this to the world actor.")]
|
||||
public class DebugPauseStateInfo : ITraitInfo
|
||||
{
|
||||
public object Create(ActorInitializer init) { return new DebugPauseState(init.world); }
|
||||
public object Create(ActorInitializer init) { return new DebugPauseState(init.World); }
|
||||
}
|
||||
|
||||
public class DebugPauseState : ISync
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace OpenRA.Traits
|
||||
{
|
||||
public readonly int Ticks = 60;
|
||||
|
||||
public virtual object Create(ActorInitializer init) { return new DrawLineToTarget(init.self, this); }
|
||||
public virtual object Create(ActorInitializer init) { return new DrawLineToTarget(init.Self, this); }
|
||||
}
|
||||
|
||||
public class DrawLineToTarget : IPostRenderSelection, INotifySelected, INotifyBecomingIdle
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace OpenRA.Traits
|
||||
[Desc("Required for FrozenUnderFog to work. Attach this to the player actor.")]
|
||||
public class FrozenActorLayerInfo : ITraitInfo
|
||||
{
|
||||
public object Create(ActorInitializer init) { return new FrozenActorLayer(init.self); }
|
||||
public object Create(ActorInitializer init) { return new FrozenActorLayer(init.Self); }
|
||||
}
|
||||
|
||||
public class FrozenActor
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace OpenRA.Traits
|
||||
[Desc("Allow palette modifiers to change the palette.")]
|
||||
public readonly bool AllowModifiers = true;
|
||||
|
||||
public object Create(ActorInitializer init) { return new PlayerColorPalette(init.self.Owner, this); }
|
||||
public object Create(ActorInitializer init) { return new PlayerColorPalette(init.Self.Owner, this); }
|
||||
}
|
||||
|
||||
public class PlayerColorPalette : ILoadsPalettes
|
||||
|
||||
@@ -20,7 +20,7 @@ namespace OpenRA.Traits
|
||||
[Desc("The prefix for the resulting player palettes")]
|
||||
public readonly string BaseName = "highlight";
|
||||
|
||||
public object Create(ActorInitializer init) { return new PlayerHighlightPalette(init.self.Owner, this); }
|
||||
public object Create(ActorInitializer init) { return new PlayerHighlightPalette(init.Self.Owner, this); }
|
||||
}
|
||||
|
||||
public class PlayerHighlightPalette : ILoadsPalettes
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace OpenRA.Traits
|
||||
public readonly int DefaultCash = 5000;
|
||||
public readonly int AdviceInterval = 250;
|
||||
|
||||
public object Create(ActorInitializer init) { return new PlayerResources(init.self, this); }
|
||||
public object Create(ActorInitializer init) { return new PlayerResources(init.Self, this); }
|
||||
}
|
||||
|
||||
public class PlayerResources : ITick, ISync
|
||||
|
||||
@@ -22,7 +22,7 @@ namespace OpenRA.Traits
|
||||
public readonly int[] Bounds = null;
|
||||
[VoiceReference] public readonly string Voice = null;
|
||||
|
||||
public object Create(ActorInitializer init) { return new Selectable(init.self, this); }
|
||||
public object Create(ActorInitializer init) { return new Selectable(init.Self, this); }
|
||||
}
|
||||
|
||||
public class Selectable : IPostRenderSelection
|
||||
|
||||
@@ -18,7 +18,7 @@ namespace OpenRA.Traits
|
||||
{
|
||||
public readonly string Palette = "chrome";
|
||||
|
||||
public object Create(ActorInitializer init) { return new SelectionDecorations(init.self, this); }
|
||||
public object Create(ActorInitializer init) { return new SelectionDecorations(init.Self, this); }
|
||||
}
|
||||
|
||||
public class SelectionDecorations : IPostRenderSelection
|
||||
@@ -68,7 +68,7 @@ namespace OpenRA.Traits
|
||||
pipImages.PlayFetchIndex("groups", () => (int)group);
|
||||
pipImages.Tick();
|
||||
|
||||
var pos = basePosition - (0.5f * pipImages.Image.size).ToInt2() + new int2(9, 5);
|
||||
var pos = basePosition - (0.5f * pipImages.Image.Size).ToInt2() + new int2(9, 5);
|
||||
yield return new UISpriteRenderable(pipImages.Image, pos, 0, pal, 1f);
|
||||
}
|
||||
|
||||
@@ -81,7 +81,7 @@ namespace OpenRA.Traits
|
||||
var pipImages = new Animation(self.World, "pips");
|
||||
pipImages.PlayRepeating(PipStrings[0]);
|
||||
|
||||
var pipSize = pipImages.Image.size.ToInt2();
|
||||
var pipSize = pipImages.Image.Size.ToInt2();
|
||||
var pipxyBase = basePosition + new int2(1 - pipSize.X / 2, -(3 + pipSize.Y / 2));
|
||||
var pipxyOffset = new int2(0, 0);
|
||||
var pal = wr.Palette(Info.Palette);
|
||||
@@ -127,7 +127,7 @@ namespace OpenRA.Traits
|
||||
continue;
|
||||
|
||||
tagImages.PlayRepeating(TagStrings[(int)tag]);
|
||||
var pos = basePosition + tagxyOffset - (0.5f * tagImages.Image.size).ToInt2();
|
||||
var pos = basePosition + tagxyOffset - (0.5f * tagImages.Image.Size).ToInt2();
|
||||
yield return new UISpriteRenderable(tagImages.Image, pos, 0, pal, 1f);
|
||||
|
||||
// Increment row
|
||||
|
||||
@@ -21,7 +21,7 @@ namespace OpenRA.Traits
|
||||
[Desc("Size of partition bins (cells)")]
|
||||
public readonly int BinSize = 10;
|
||||
|
||||
public object Create(ActorInitializer init) { return new ActorMap(init.world, this); }
|
||||
public object Create(ActorInitializer init) { return new ActorMap(init.World, this); }
|
||||
}
|
||||
|
||||
public class ActorMap : ITick
|
||||
|
||||
@@ -34,7 +34,7 @@ namespace OpenRA.Traits
|
||||
|
||||
public PipType PipColor = PipType.Yellow;
|
||||
|
||||
public object Create(ActorInitializer init) { return new ResourceType(this, init.world); }
|
||||
public object Create(ActorInitializer init) { return new ResourceType(this, init.World); }
|
||||
}
|
||||
|
||||
public class ResourceType : IWorldLoaded
|
||||
|
||||
4
OpenRA.Game/Traits/World/ScreenMap.cs
Executable file → Normal file
4
OpenRA.Game/Traits/World/ScreenMap.cs
Executable file → Normal file
@@ -22,7 +22,7 @@ namespace OpenRA.Traits
|
||||
[Desc("Size of partition bins (world pixels)")]
|
||||
public readonly int BinSize = 250;
|
||||
|
||||
public object Create(ActorInitializer init) { return new ScreenMap(init.world, this); }
|
||||
public object Create(ActorInitializer init) { return new ScreenMap(init.World, this); }
|
||||
}
|
||||
|
||||
public class ScreenMap : IWorldLoaded
|
||||
@@ -36,7 +36,7 @@ namespace OpenRA.Traits
|
||||
public ScreenMap(World world, ScreenMapInfo info)
|
||||
{
|
||||
this.info = info;
|
||||
var ts = Game.modData.Manifest.TileSize;
|
||||
var ts = Game.ModData.Manifest.TileSize;
|
||||
cols = world.Map.MapSize.X * ts.Width / info.BinSize + 1;
|
||||
rows = world.Map.MapSize.Y * ts.Height / info.BinSize + 1;
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ namespace OpenRA.Traits
|
||||
[Desc("Required for shroud and fog visibility checks. Add this to the player actor.")]
|
||||
public class ShroudInfo : ITraitInfo
|
||||
{
|
||||
public object Create(ActorInitializer init) { return new Shroud(init.self); }
|
||||
public object Create(ActorInitializer init) { return new Shroud(init.Self); }
|
||||
}
|
||||
|
||||
public class Shroud
|
||||
|
||||
Reference in New Issue
Block a user