diff --git a/Makefile b/Makefile index 99f3ed67bf..831fb9b5d5 100644 --- a/Makefile +++ b/Makefile @@ -179,6 +179,8 @@ test: @mono --debug OpenRA.Utility.exe ts --check-yaml check: + @echo "Checking for code style violations in OpenRA.Game..." + @mono --debug OpenRA.Utility.exe ra --check-code-style OpenRA.Game @echo "Checking for code style violations in OpenRA.Renderer.Null..." @mono --debug OpenRA.Utility.exe ra --check-code-style OpenRA.Renderer.Null @echo "Checking for code style violations in OpenRA.GameMonitor..." diff --git a/OpenRA.Editor/Form1.cs b/OpenRA.Editor/Form1.cs index 1cfef73fbb..cd8fd3dcdc 100644 --- a/OpenRA.Editor/Form1.cs +++ b/OpenRA.Editor/Form1.cs @@ -47,11 +47,11 @@ namespace OpenRA.Editor currentMod = toolStripComboBox1.SelectedItem as string; Game.InitializeSettings(Arguments.Empty); - Game.modData = new ModData(currentMod); - GlobalFileSystem.LoadFromManifest(Game.modData.Manifest); - Program.Rules = Game.modData.RulesetCache.LoadDefaultRules(); + Game.ModData = new ModData(currentMod); + GlobalFileSystem.LoadFromManifest(Game.ModData.Manifest); + Program.Rules = Game.ModData.RulesetCache.LoadDefaultRules(); - var mod = Game.modData.Manifest.Mod; + var mod = Game.ModData.Manifest.Mod; Text = "{0} Mod Version: {1} - OpenRA Editor".F(mod.Title, mod.Version); loadedMapName = null; @@ -129,7 +129,7 @@ namespace OpenRA.Editor if (map.Players.Count == 0) map.MakeDefaultPlayers(); - PrepareMapResources(Game.modData, map); + PrepareMapResources(Game.ModData, map); // Calculate total net worth of resources in cash cashToolStripStatusLabel.Text = CalculateTotalResource().ToString(); @@ -144,7 +144,7 @@ namespace OpenRA.Editor resourcePalette.Controls.Clear(); loadedMapName = null; - PrepareMapResources(Game.modData, map); + PrepareMapResources(Game.ModData, map); MakeDirty(); } diff --git a/OpenRA.Editor/Surface.cs b/OpenRA.Editor/Surface.cs index fc5e33fbcc..21ac38ba4f 100644 --- a/OpenRA.Editor/Surface.cs +++ b/OpenRA.Editor/Surface.cs @@ -312,7 +312,7 @@ namespace OpenRA.Editor { using (var g = SGraphics.FromImage(bitmap)) { - var ts = Game.modData.Manifest.TileSize; + var ts = Game.ModData.Manifest.TileSize; var rect = new Rectangle(0, 0, bitmap.Width, bitmap.Height); ControlPaint.DrawGrid(g, rect, new Size(2, ts.Height), Color.DarkRed); ControlPaint.DrawGrid(g, rect, new Size(ts.Width, 2), Color.DarkRed); diff --git a/OpenRA.Editor/TileSetRenderer.cs b/OpenRA.Editor/TileSetRenderer.cs index caf8759a43..6773b56fc7 100644 --- a/OpenRA.Editor/TileSetRenderer.cs +++ b/OpenRA.Editor/TileSetRenderer.cs @@ -50,7 +50,7 @@ namespace OpenRA.Editor this.TileSize = Math.Min(tileSize.Width, tileSize.Height); templates = new Dictionary(); - var frameCache = new FrameCache(Game.modData.SpriteLoaders, tileset.Extensions); + var frameCache = new FrameCache(Game.ModData.SpriteLoaders, tileset.Extensions); foreach (var t in tileset.Templates) { var allFrames = frameCache[t.Value.Image]; diff --git a/OpenRA.Game/Actor.cs b/OpenRA.Game/Actor.cs index cf2467f28c..28e872c039 100644 --- a/OpenRA.Game/Actor.cs +++ b/OpenRA.Game/Actor.cs @@ -180,27 +180,27 @@ namespace OpenRA public T Trait() { - return World.traitDict.Get(this); + return World.TraitDict.Get(this); } public T TraitOrDefault() { - return World.traitDict.GetOrDefault(this); + return World.TraitDict.GetOrDefault(this); } public IEnumerable TraitsImplementing() { - return World.traitDict.WithInterface(this); + return World.TraitDict.WithInterface(this); } public bool HasTrait() { - return World.traitDict.Contains(this); + return World.TraitDict.Contains(this); } public void AddTrait(object trait) { - World.traitDict.AddTrait(this, trait); + World.TraitDict.AddTrait(this, trait); } public void Destroy() @@ -213,7 +213,7 @@ namespace OpenRA if (IsInWorld) World.Remove(this); - World.traitDict.RemoveActor(this); + World.TraitDict.RemoveActor(this); Destroyed = true; if (luaInterface != null) diff --git a/OpenRA.Game/Game.cs b/OpenRA.Game/Game.cs index 7fe650f61f..0315daef3c 100644 --- a/OpenRA.Game/Game.cs +++ b/OpenRA.Game/Game.cs @@ -31,12 +31,12 @@ namespace OpenRA public const int Timestep = 40; public const int TimestepJankThreshold = 250; // Don't catch up for delays larger than 250ms - public static ModData modData; + public static ModData ModData; public static Settings Settings; public static ICursor Cursor; static WorldRenderer worldRenderer; - internal static OrderManager orderManager; + internal static OrderManager OrderManager; static Server.Server server; public static MersenneTwister CosmeticRandom = new MersenneTwister(); // not synced @@ -64,10 +64,10 @@ namespace OpenRA static void JoinInner(OrderManager om) { - if (orderManager != null) orderManager.Dispose(); - orderManager = om; + if (OrderManager != null) OrderManager.Dispose(); + OrderManager = om; lastConnectionState = ConnectionState.PreConnecting; - ConnectionStateChanged(orderManager); + ConnectionStateChanged(OrderManager); } public static void JoinReplay(string replayFile) @@ -85,13 +85,13 @@ namespace OpenRA public static int RunTime { get { return (int)Game.stopwatch.ElapsedMilliseconds; } } public static int RenderFrame = 0; - public static int NetFrameNumber { get { return orderManager.NetFrameNumber; } } - public static int LocalTick { get { return orderManager.LocalFrameNumber; } } + public static int NetFrameNumber { get { return OrderManager.NetFrameNumber; } } + public static int LocalTick { get { return OrderManager.LocalFrameNumber; } } public static event Action OnRemoteDirectConnect = (a, b) => { }; public static event Action ConnectionStateChanged = _ => { }; static ConnectionState lastConnectionState = ConnectionState.PreConnecting; - public static int LocalClientId { get { return orderManager.Connection.LocalClientId; } } + public static int LocalClientId { get { return OrderManager.Connection.LocalClientId; } } public static void RemoteDirectConnect(string host, int port) { @@ -101,7 +101,7 @@ namespace OpenRA // Hacky workaround for orderManager visibility public static Widget OpenWindow(World world, string widget) { - return Ui.OpenWindow(widget, new WidgetArgs() { { "world", world }, { "orderManager", orderManager }, { "worldRenderer", worldRenderer } }); + return Ui.OpenWindow(widget, new WidgetArgs() { { "world", world }, { "orderManager", OrderManager }, { "worldRenderer", worldRenderer } }); } // Who came up with the great idea of making these things @@ -110,8 +110,8 @@ namespace OpenRA { return Ui.OpenWindow(widget, new WidgetArgs(args) { - { "world", worldRenderer.world }, - { "orderManager", orderManager }, + { "world", worldRenderer.World }, + { "orderManager", OrderManager }, { "worldRenderer", worldRenderer }, }); } @@ -119,10 +119,10 @@ namespace OpenRA // Load a widget with world, orderManager, worldRenderer args, without adding it to the widget tree public static Widget LoadWidget(World world, string id, Widget parent, WidgetArgs args) { - return modData.WidgetLoader.LoadWidget(new WidgetArgs(args) + return ModData.WidgetLoader.LoadWidget(new WidgetArgs(args) { { "world", world }, - { "orderManager", orderManager }, + { "orderManager", OrderManager }, { "worldRenderer", worldRenderer }, }, parent, id); } @@ -143,29 +143,29 @@ namespace OpenRA Map map; using (new PerfTimer("PrepareMap")) - map = modData.PrepareMap(mapUID); + map = ModData.PrepareMap(mapUID); using (new PerfTimer("NewWorld")) { - orderManager.World = new World(map, orderManager, isShellmap); - orderManager.World.Timestep = Timestep; + OrderManager.World = new World(map, OrderManager, isShellmap); + OrderManager.World.Timestep = Timestep; } if (worldRenderer != null) worldRenderer.Dispose(); - worldRenderer = new WorldRenderer(orderManager.World); + worldRenderer = new WorldRenderer(OrderManager.World); using (new PerfTimer("LoadComplete")) - orderManager.World.LoadComplete(worldRenderer); + OrderManager.World.LoadComplete(worldRenderer); - if (orderManager.GameStarted) + if (OrderManager.GameStarted) return; Ui.MouseFocusWidget = null; Ui.KeyboardFocusWidget = null; - orderManager.LocalFrameNumber = 0; - orderManager.LastTickTime = RunTime; - orderManager.StartGame(); + OrderManager.LocalFrameNumber = 0; + OrderManager.LastTickTime = RunTime; + OrderManager.StartGame(); worldRenderer.RefreshPalette(); Cursor.SetCursor("default"); @@ -176,8 +176,8 @@ namespace OpenRA { get { - var id = orderManager.Connection.LocalClientId; - var client = orderManager.LobbyInfo.ClientWithIndex(id); + var id = OrderManager.Connection.LocalClientId; + var client = OrderManager.LobbyInfo.ClientWithIndex(id); return client != null && client.IsAdmin; } } @@ -282,12 +282,12 @@ namespace OpenRA worldRenderer = null; if (server != null) server.Shutdown(); - if (orderManager != null) - orderManager.Dispose(); + if (OrderManager != null) + OrderManager.Dispose(); - if (modData != null) - modData.Dispose(); - modData = null; + if (ModData != null) + ModData.Dispose(); + ModData = null; // Fall back to default if the mod doesn't exist if (!ModMetadata.AllMods.ContainsKey(mod)) @@ -300,18 +300,18 @@ namespace OpenRA Sound.StopVideo(); Sound.Initialize(); - modData = new ModData(mod, true); + ModData = new ModData(mod, true); - Renderer.InitializeFonts(modData.Manifest); - modData.InitializeLoaders(); + Renderer.InitializeFonts(ModData.Manifest); + ModData.InitializeLoaders(); using (new PerfTimer("LoadMaps")) - modData.MapCache.LoadMaps(); + ModData.MapCache.LoadMaps(); if (Settings.Graphics.HardwareCursors) { try { - Cursor = new HardwareCursor(modData.CursorProvider); + Cursor = new HardwareCursor(ModData.CursorProvider); } catch (Exception e) { @@ -321,12 +321,12 @@ namespace OpenRA Console.WriteLine("Failed to initialize hardware cursors. Falling back to software cursors."); Console.WriteLine("Error was: " + e.Message); - Cursor = new SoftwareCursor(modData.CursorProvider); + Cursor = new SoftwareCursor(ModData.CursorProvider); Settings.Graphics.HardwareCursors = false; } } else - Cursor = new SoftwareCursor(modData.CursorProvider); + Cursor = new SoftwareCursor(ModData.CursorProvider); PerfHistory.Items["render"].HasNormalTick = false; PerfHistory.Items["batches"].HasNormalTick = false; @@ -357,7 +357,7 @@ namespace OpenRA if (Settings.Server.DedicatedLoop) { Console.WriteLine("Starting a new server instance..."); - modData.MapCache.LoadMaps(); + ModData.MapCache.LoadMaps(); continue; } @@ -367,7 +367,7 @@ namespace OpenRA Environment.Exit(0); } else - modData.LoadScreen.StartGame(args); + ModData.LoadScreen.StartGame(args); } public static void LoadShellMap() @@ -380,7 +380,7 @@ namespace OpenRA static string ChooseShellmap() { - var shellmaps = modData.MapCache + var shellmaps = ModData.MapCache .Where(m => m.Status == MapStatus.Available && m.Map.Visibility.HasFlag(MapVisibility.Shellmap)) .Select(m => m.Uid); @@ -471,15 +471,15 @@ namespace OpenRA { delayedActions.PerformActions(); - if (orderManager.Connection.ConnectionState != lastConnectionState) + if (OrderManager.Connection.ConnectionState != lastConnectionState) { - lastConnectionState = orderManager.Connection.ConnectionState; - ConnectionStateChanged(orderManager); + lastConnectionState = OrderManager.Connection.ConnectionState; + ConnectionStateChanged(OrderManager); } - InnerLogicTick(orderManager); - if (worldRenderer != null && orderManager.World != worldRenderer.world) - InnerLogicTick(worldRenderer.world.orderManager); + InnerLogicTick(OrderManager); + if (worldRenderer != null && OrderManager.World != worldRenderer.World) + InnerLogicTick(worldRenderer.World.OrderManager); } static void RenderTick() @@ -502,7 +502,7 @@ namespace OpenRA { Ui.Draw(); - if (modData != null && modData.CursorProvider != null) + if (ModData != null && ModData.CursorProvider != null) { Cursor.SetCursor(Ui.Root.GetCursorOuter(Viewport.LastMousePos) ?? "default"); Cursor.Render(Renderer); @@ -510,7 +510,7 @@ namespace OpenRA } using (new PerfSample("render_flip")) - Renderer.EndFrame(new DefaultInputHandler(orderManager.World)); + Renderer.EndFrame(new DefaultInputHandler(OrderManager.World)); } PerfHistory.Items["render"].Tick(); @@ -567,7 +567,7 @@ namespace OpenRA { // Ideal time between logic updates. Timestep = 0 means the game is paused // but we still call LogicTick() because it handles pausing internally. - var logicInterval = worldRenderer != null && worldRenderer.world.Timestep != 0 ? worldRenderer.world.Timestep : Game.Timestep; + var logicInterval = worldRenderer != null && worldRenderer.World.Timestep != 0 ? worldRenderer.World.Timestep : Game.Timestep; // Ideal time between screen updates var maxFramerate = Settings.Graphics.CapFramerate ? Settings.Graphics.MaxFramerate.Clamp(1, 1000) : 1000; @@ -592,7 +592,7 @@ namespace OpenRA LogicTick(); // Force at least one render per tick during regular gameplay - if (orderManager.World != null && !orderManager.World.IsReplay) + if (OrderManager.World != null && !OrderManager.World.IsReplay) forceRender = true; } @@ -636,13 +636,13 @@ namespace OpenRA finally { // Ensure that the active replay is properly saved - if (orderManager != null) - orderManager.Dispose(); + if (OrderManager != null) + OrderManager.Dispose(); } if (worldRenderer != null) worldRenderer.Dispose(); - modData.Dispose(); + ModData.Dispose(); ChromeProvider.Deinitialize(); Renderer.Dispose(); @@ -663,7 +663,7 @@ namespace OpenRA public static void AddChatLine(Color color, string name, string text) { - orderManager.AddChatLine(color, name, text); + OrderManager.AddChatLine(color, name, text); } public static void Debug(string s, params object[] args) @@ -673,10 +673,10 @@ namespace OpenRA public static void Disconnect() { - if (orderManager.World != null) - orderManager.World.traitDict.PrintReport(); + if (OrderManager.World != null) + OrderManager.World.TraitDict.PrintReport(); - orderManager.Dispose(); + OrderManager.Dispose(); CloseServer(); JoinLocal(); } @@ -689,12 +689,12 @@ namespace OpenRA public static T CreateObject(string name) { - return modData.ObjectCreator.CreateObject(name); + return ModData.ObjectCreator.CreateObject(name); } public static void CreateServer(ServerSettings settings) { - server = new Server.Server(new IPEndPoint(IPAddress.Any, settings.ListenPort), settings, modData); + server = new Server.Server(new IPEndPoint(IPAddress.Any, settings.ListenPort), settings, ModData); } public static int CreateLocalServer(string map) @@ -707,14 +707,14 @@ namespace OpenRA AllowPortForward = false }; - server = new Server.Server(new IPEndPoint(IPAddress.Loopback, 0), settings, modData); + server = new Server.Server(new IPEndPoint(IPAddress.Loopback, 0), settings, ModData); return server.Port; } public static bool IsCurrentWorld(World world) { - return orderManager != null && orderManager.World == world; + return OrderManager != null && OrderManager.World == world; } } } diff --git a/OpenRA.Game/GameInformation.cs b/OpenRA.Game/GameInformation.cs index 08b40c3b30..330ab6ae27 100644 --- a/OpenRA.Game/GameInformation.cs +++ b/OpenRA.Game/GameInformation.cs @@ -29,7 +29,7 @@ namespace OpenRA // replay recording stopped. public TimeSpan Duration { get { return EndTimeUtc > StartTimeUtc ? EndTimeUtc - StartTimeUtc : TimeSpan.Zero; } } public IList Players { get; private set; } - public MapPreview MapPreview { get { return Game.modData.MapCache[MapUid]; } } + public MapPreview MapPreview { get { return Game.ModData.MapCache[MapUid]; } } public IEnumerable HumanPlayers { get { return Players.Where(p => p.IsHuman); } } public bool IsSinglePlayer { get { return HumanPlayers.Count() == 1; } } diff --git a/OpenRA.Game/Graphics/ChromeProvider.cs b/OpenRA.Game/Graphics/ChromeProvider.cs index c636c8ef5a..490a686c2d 100644 --- a/OpenRA.Game/Graphics/ChromeProvider.cs +++ b/OpenRA.Game/Graphics/ChromeProvider.cs @@ -70,7 +70,7 @@ namespace OpenRA.Graphics static void LoadCollection(string name, MiniYaml yaml) { - Game.modData.LoadScreen.Display(); + Game.ModData.LoadScreen.Display(); var collection = new Collection() { Src = yaml.Value, diff --git a/OpenRA.Game/Graphics/Renderable.cs b/OpenRA.Game/Graphics/Renderable.cs index 6143a90637..e0290eeef1 100644 --- a/OpenRA.Game/Graphics/Renderable.cs +++ b/OpenRA.Game/Graphics/Renderable.cs @@ -87,19 +87,19 @@ namespace OpenRA.Graphics float2 ScreenPosition(WorldRenderer wr) { - return wr.ScreenPxPosition(pos) + wr.ScreenPxOffset(offset) - (0.5f * scale * sprite.size).ToInt2(); + return wr.ScreenPxPosition(pos) + wr.ScreenPxOffset(offset) - (0.5f * scale * sprite.Size).ToInt2(); } public void BeforeRender(WorldRenderer wr) { } public void Render(WorldRenderer wr) { - Game.Renderer.WorldSpriteRenderer.DrawSprite(sprite, ScreenPosition(wr), palette, sprite.size * scale); + Game.Renderer.WorldSpriteRenderer.DrawSprite(sprite, ScreenPosition(wr), palette, sprite.Size * scale); } public void RenderDebugGeometry(WorldRenderer wr) { - var offset = ScreenPosition(wr) + sprite.offset; - Game.Renderer.WorldLineRenderer.DrawRect(offset, offset + sprite.size, Color.Red); + var offset = ScreenPosition(wr) + sprite.Offset; + Game.Renderer.WorldLineRenderer.DrawRect(offset, offset + sprite.Size, Color.Red); } } } diff --git a/OpenRA.Game/Graphics/Sequence.cs b/OpenRA.Game/Graphics/Sequence.cs index bd946a1dbb..3726b0068f 100644 --- a/OpenRA.Game/Graphics/Sequence.cs +++ b/OpenRA.Game/Graphics/Sequence.cs @@ -51,7 +51,7 @@ namespace OpenRA.Graphics // Apply offset to each sprite in the sequence // Different sequences may apply different offsets to the same frame sprites = cache[srcOverride ?? unit].Select( - s => new Sprite(s.sheet, s.bounds, s.offset + offset, s.channel, blendMode)).ToArray(); + s => new Sprite(s.Sheet, s.Bounds, s.Offset + offset, s.Channel, blendMode)).ToArray(); if (!d.ContainsKey("Length")) Length = 1; diff --git a/OpenRA.Game/Graphics/SoftwareCursor.cs b/OpenRA.Game/Graphics/SoftwareCursor.cs index 64a3f2af08..f5df1ff7c3 100644 --- a/OpenRA.Game/Graphics/SoftwareCursor.cs +++ b/OpenRA.Game/Graphics/SoftwareCursor.cs @@ -79,11 +79,11 @@ namespace OpenRA.Graphics var cursorSequence = cursorProvider.GetCursorSequence(cursorName); var cursorSprite = sprites[cursorName][((int)cursorFrame % cursorSequence.Length)]; - var cursorSize = CursorProvider.CursorViewportZoomed ? 2.0f * cursorSprite.size : cursorSprite.size; + var cursorSize = CursorProvider.CursorViewportZoomed ? 2.0f * cursorSprite.Size : cursorSprite.Size; var cursorOffset = CursorProvider.CursorViewportZoomed ? - (2 * cursorSequence.Hotspot) + cursorSprite.size.ToInt2() : - cursorSequence.Hotspot + (0.5f * cursorSprite.size).ToInt2(); + (2 * cursorSequence.Hotspot) + cursorSprite.Size.ToInt2() : + cursorSequence.Hotspot + (0.5f * cursorSprite.Size).ToInt2(); renderer.SetPalette(palette); renderer.SpriteRenderer.DrawSprite(cursorSprite, diff --git a/OpenRA.Game/Graphics/Sprite.cs b/OpenRA.Game/Graphics/Sprite.cs index 4cb04745d2..77b53452f9 100644 --- a/OpenRA.Game/Graphics/Sprite.cs +++ b/OpenRA.Game/Graphics/Sprite.cs @@ -14,14 +14,14 @@ namespace OpenRA.Graphics { public class Sprite { - public readonly Rectangle bounds; - public readonly Sheet sheet; - public readonly BlendMode blendMode; - public readonly TextureChannel channel; - public readonly float2 size; - public readonly float2 offset; - public readonly float2 fractionalOffset; - public readonly float top, left, bottom, right; + public readonly Rectangle Bounds; + public readonly Sheet Sheet; + public readonly BlendMode BlendMode; + public readonly TextureChannel Channel; + public readonly float2 Size; + public readonly float2 Offset; + public readonly float2 FractionalOffset; + public readonly float Top, Left, Bottom, Right; public Sprite(Sheet sheet, Rectangle bounds, TextureChannel channel) : this(sheet, bounds, float2.Zero, channel, BlendMode.Alpha) { } @@ -31,19 +31,19 @@ namespace OpenRA.Graphics public Sprite(Sheet sheet, Rectangle bounds, float2 offset, TextureChannel channel, BlendMode blendMode) { - this.sheet = sheet; - this.bounds = bounds; - this.offset = offset; - this.channel = channel; - this.size = new float2(bounds.Size); - this.blendMode = blendMode; + Sheet = sheet; + Bounds = bounds; + Offset = offset; + Channel = channel; + Size = new float2(bounds.Size); + BlendMode = blendMode; - this.fractionalOffset = offset / this.size; + FractionalOffset = offset / Size; - left = (float)bounds.Left / sheet.Size.Width; - top = (float)bounds.Top / sheet.Size.Height; - right = (float)bounds.Right / sheet.Size.Width; - bottom = (float)bounds.Bottom / sheet.Size.Height; + Left = (float)bounds.Left / sheet.Size.Width; + Top = (float)bounds.Top / sheet.Size.Height; + Right = (float)bounds.Right / sheet.Size.Width; + Bottom = (float)bounds.Bottom / sheet.Size.Height; } } diff --git a/OpenRA.Game/Graphics/SpriteFont.cs b/OpenRA.Game/Graphics/SpriteFont.cs index df34fe72a1..168ba8895e 100644 --- a/OpenRA.Game/Graphics/SpriteFont.cs +++ b/OpenRA.Game/Graphics/SpriteFont.cs @@ -117,15 +117,15 @@ namespace OpenRA.Graphics unsafe { var p = (byte*)bitmap.Buffer; - var dest = s.sheet.GetData(); - var destStride = s.sheet.Size.Width * 4; + var dest = s.Sheet.GetData(); + var destStride = s.Sheet.Size.Width * 4; - for (var j = 0; j < s.size.Y; j++) + for (var j = 0; j < s.Size.Y; j++) { - for (var i = 0; i < s.size.X; i++) + for (var i = 0; i < s.Size.X; i++) if (p[i] != 0) { - var q = destStride * (j + s.bounds.Top) + 4 * (i + s.bounds.Left); + var q = destStride * (j + s.Bounds.Top) + 4 * (i + s.Bounds.Left); dest[q] = c.Second.B; dest[q + 1] = c.Second.G; dest[q + 2] = c.Second.R; @@ -136,7 +136,7 @@ namespace OpenRA.Graphics } } - s.sheet.CommitData(); + s.Sheet.CommitData(); return g; } diff --git a/OpenRA.Game/Graphics/SpriteRenderer.cs b/OpenRA.Game/Graphics/SpriteRenderer.cs index 10a0ce6b9b..2605f49b9a 100644 --- a/OpenRA.Game/Graphics/SpriteRenderer.cs +++ b/OpenRA.Game/Graphics/SpriteRenderer.cs @@ -51,7 +51,7 @@ namespace OpenRA.Graphics public void DrawSprite(Sprite s, float2 location, PaletteReference pal) { - DrawSprite(s, location, pal.Index, s.size); + DrawSprite(s, location, pal.Index, s.Size); } public void DrawSprite(Sprite s, float2 location, PaletteReference pal, float2 size) @@ -63,25 +63,25 @@ namespace OpenRA.Graphics { renderer.CurrentBatchRenderer = this; - if (s.sheet != currentSheet) + if (s.Sheet != currentSheet) Flush(); - if (s.blendMode != currentBlend) + if (s.BlendMode != currentBlend) Flush(); if (nv + 4 > renderer.TempBufferSize) Flush(); - currentBlend = s.blendMode; - currentSheet = s.sheet; - Util.FastCreateQuad(vertices, location + s.fractionalOffset * size, s, paletteIndex, nv, size); + currentBlend = s.BlendMode; + currentSheet = s.Sheet; + Util.FastCreateQuad(vertices, location + s.FractionalOffset * size, s, paletteIndex, nv, size); nv += 4; } // For RGBASpriteRenderer, which doesn't use palettes public void DrawSprite(Sprite s, float2 location) { - DrawSprite(s, location, 0, s.size); + DrawSprite(s, location, 0, s.Size); } public void DrawSprite(Sprite s, float2 location, float2 size) @@ -93,17 +93,17 @@ namespace OpenRA.Graphics { renderer.CurrentBatchRenderer = this; - if (s.sheet != currentSheet) + if (s.Sheet != currentSheet) Flush(); - if (s.blendMode != currentBlend) + if (s.BlendMode != currentBlend) Flush(); if (nv + 4 > renderer.TempBufferSize) Flush(); - currentSheet = s.sheet; - currentBlend = s.blendMode; + currentSheet = s.Sheet; + currentBlend = s.BlendMode; Util.FastCreateQuad(vertices, a, b, c, d, s, 0, nv); nv += 4; } diff --git a/OpenRA.Game/Graphics/TerrainRenderer.cs b/OpenRA.Game/Graphics/TerrainRenderer.cs index dffe1bf2c3..2ab54a509f 100644 --- a/OpenRA.Game/Graphics/TerrainRenderer.cs +++ b/OpenRA.Game/Graphics/TerrainRenderer.cs @@ -31,8 +31,8 @@ namespace OpenRA.Graphics foreach (var cell in map.Cells) { var tile = wr.Theater.TileSprite(map.MapTiles.Value[cell]); - var pos = wr.ScreenPosition(map.CenterOfCell(cell)) + tile.offset - 0.5f * tile.size; - Util.FastCreateQuad(vertices, pos, tile, terrainPalette, nv, tile.size); + var pos = wr.ScreenPosition(map.CenterOfCell(cell)) + tile.Offset - 0.5f * tile.Size; + Util.FastCreateQuad(vertices, pos, tile, terrainPalette, nv, tile.Size); nv += 4; } @@ -44,7 +44,7 @@ namespace OpenRA.Graphics { var verticesPerRow = 4 * map.Bounds.Width; var cells = viewport.VisibleCells; - var shape = wr.world.Map.TileShape; + var shape = wr.World.Map.TileShape; // Only draw the rows that are visible. // VisibleCells is clamped to the map, so additional checks are unnecessary diff --git a/OpenRA.Game/Graphics/Theater.cs b/OpenRA.Game/Graphics/Theater.cs index 3972a6f564..408e96ecd5 100644 --- a/OpenRA.Game/Graphics/Theater.cs +++ b/OpenRA.Game/Graphics/Theater.cs @@ -39,7 +39,7 @@ namespace OpenRA.Graphics sheetBuilder = new SheetBuilder(SheetType.Indexed, allocate); templates = new Dictionary(); - var frameCache = new FrameCache(Game.modData.SpriteLoaders, tileset.Extensions); + var frameCache = new FrameCache(Game.ModData.SpriteLoaders, tileset.Extensions); foreach (var t in tileset.Templates) { var allFrames = frameCache[t.Value.Image]; @@ -48,7 +48,7 @@ namespace OpenRA.Graphics // Ignore the offsets baked into R8 sprites if (tileset.IgnoreTileSpriteOffsets) - sprites = sprites.Select(s => new Sprite(s.sheet, s.bounds, float2.Zero, s.channel, s.blendMode)); + sprites = sprites.Select(s => new Sprite(s.Sheet, s.Bounds, float2.Zero, s.Channel, s.BlendMode)); templates.Add(t.Value.Id, sprites.ToArray()); } @@ -91,8 +91,8 @@ namespace OpenRA.Graphics var u = tileShape == TileShape.Rectangle ? x : (x - y) / 2f; var v = tileShape == TileShape.Rectangle ? y : (x + y) / 2f; - var tl = new float2(u * tileSize.Width, (v - 0.5f * tileInfo.Height) * tileSize.Height) - 0.5f * sprite.size; - var rect = new Rectangle((int)(tl.X + sprite.offset.X), (int)(tl.Y + sprite.offset.Y), (int)sprite.size.X, (int)sprite.size.Y); + var tl = new float2(u * tileSize.Width, (v - 0.5f * tileInfo.Height) * tileSize.Height) - 0.5f * sprite.Size; + var rect = new Rectangle((int)(tl.X + sprite.Offset.X), (int)(tl.Y + sprite.Offset.Y), (int)sprite.Size.X, (int)sprite.Size.Y); templateRect = templateRect.HasValue ? Rectangle.Union(templateRect.Value, rect) : rect; } } diff --git a/OpenRA.Game/Graphics/UISpriteRenderable.cs b/OpenRA.Game/Graphics/UISpriteRenderable.cs index 0b43b81a4d..a35fea0b12 100644 --- a/OpenRA.Game/Graphics/UISpriteRenderable.cs +++ b/OpenRA.Game/Graphics/UISpriteRenderable.cs @@ -49,13 +49,13 @@ namespace OpenRA.Graphics public void BeforeRender(WorldRenderer wr) { } public void Render(WorldRenderer wr) { - Game.Renderer.SpriteRenderer.DrawSprite(sprite, screenPos, palette, sprite.size * scale); + Game.Renderer.SpriteRenderer.DrawSprite(sprite, screenPos, palette, sprite.Size * scale); } public void RenderDebugGeometry(WorldRenderer wr) { - var offset = screenPos + sprite.offset; - Game.Renderer.LineRenderer.DrawRect(offset, offset + sprite.size, Color.Red); + var offset = screenPos + sprite.Offset; + Game.Renderer.LineRenderer.DrawRect(offset, offset + sprite.Size, Color.Red); } } } diff --git a/OpenRA.Game/Graphics/Util.cs b/OpenRA.Game/Graphics/Util.cs index 0671b9c778..977837c4f5 100644 --- a/OpenRA.Game/Graphics/Util.cs +++ b/OpenRA.Game/Graphics/Util.cs @@ -18,8 +18,8 @@ namespace OpenRA.Graphics public static class Util { // yes, our channel order is nuts. - static readonly int[] channelMasks = { 2, 1, 0, 3 }; - static float[] channelSelect = { 0.75f, 0.25f, -0.25f, -0.75f }; + static readonly int[] ChannelMasks = { 2, 1, 0, 3 }; + static readonly float[] ChannelSelect = { 0.75f, 0.25f, -0.25f, -0.75f }; public static void FastCreateQuad(Vertex[] vertices, float2 o, Sprite r, int palette, int nv, float2 size) { @@ -32,23 +32,23 @@ namespace OpenRA.Graphics public static void FastCreateQuad(Vertex[] vertices, float2 a, float2 b, float2 c, float2 d, Sprite r, int palette, int nv) { var attribP = palette / (float)HardwarePalette.MaxPalettes; - var attribC = channelSelect[(int)r.channel]; + var attribC = ChannelSelect[(int)r.Channel]; - vertices[nv] = new Vertex(a, r.left, r.top, attribP, attribC); - vertices[nv + 1] = new Vertex(b, r.right, r.top, attribP, attribC); - vertices[nv + 2] = new Vertex(c, r.right, r.bottom, attribP, attribC); - vertices[nv + 3] = new Vertex(d, r.left, r.bottom, attribP, attribC); + vertices[nv] = new Vertex(a, r.Left, r.Top, attribP, attribC); + vertices[nv + 1] = new Vertex(b, r.Right, r.Top, attribP, attribC); + vertices[nv + 2] = new Vertex(c, r.Right, r.Bottom, attribP, attribC); + vertices[nv + 3] = new Vertex(d, r.Left, r.Bottom, attribP, attribC); } public static void FastCopyIntoChannel(Sprite dest, byte[] src) { FastCopyIntoChannel(dest, 0, src); } public static void FastCopyIntoChannel(Sprite dest, int channelOffset, byte[] src) { - var data = dest.sheet.GetData(); - var srcStride = dest.bounds.Width; - var destStride = dest.sheet.Size.Width * 4; - var destOffset = destStride * dest.bounds.Top + dest.bounds.Left * 4 + channelMasks[(int)dest.channel + channelOffset]; + var data = dest.Sheet.GetData(); + var srcStride = dest.Bounds.Width; + var destStride = dest.Sheet.Size.Width * 4; + var destOffset = destStride * dest.Bounds.Top + dest.Bounds.Left * 4 + ChannelMasks[(int)dest.Channel + channelOffset]; var destSkip = destStride - 4 * srcStride; - var height = dest.bounds.Height; + var height = dest.Bounds.Height; var srcOffset = 0; for (var j = 0; j < height; j++) @@ -65,12 +65,12 @@ namespace OpenRA.Graphics public static void FastCopyIntoSprite(Sprite dest, Bitmap src) { - var data = dest.sheet.GetData(); - var dataStride = dest.sheet.Size.Width * 4; - var x = dest.bounds.Left * 4; - var width = dest.bounds.Width * 4; - var y = dest.bounds.Top; - var height = dest.bounds.Height; + var data = dest.Sheet.GetData(); + var dataStride = dest.Sheet.Size.Width * 4; + var x = dest.Bounds.Left * 4; + var width = dest.Bounds.Width * 4; + var y = dest.Bounds.Top; + var height = dest.Bounds.Height; var bd = src.LockBits(src.Bounds(), ImageLockMode.ReadWrite, PixelFormat.Format32bppArgb); diff --git a/OpenRA.Game/Graphics/Viewport.cs b/OpenRA.Game/Graphics/Viewport.cs index d9a8513a88..9787493a1c 100644 --- a/OpenRA.Game/Graphics/Viewport.cs +++ b/OpenRA.Game/Graphics/Viewport.cs @@ -98,14 +98,14 @@ namespace OpenRA.Graphics var br = wr.ScreenPxPosition(map.CenterOfCell(Map.MapToCell(map.TileShape, new CPos(b.Right, b.Bottom))) + new WVec(511, 511, 0)); mapBounds = Rectangle.FromLTRB(tl.X, tl.Y, br.X, br.Y); - maxGroundHeight = wr.world.TileSet.MaxGroundHeight; + maxGroundHeight = wr.World.TileSet.MaxGroundHeight; CenterLocation = (tl + br) / 2; Zoom = Game.Settings.Graphics.PixelDouble ? 2 : 1; } public CPos ViewToWorld(int2 view) { - return worldRenderer.world.Map.CellContaining(worldRenderer.Position(ViewToWorldPx(view))); + return worldRenderer.World.Map.CellContaining(worldRenderer.Position(ViewToWorldPx(view))); } public int2 ViewToWorldPx(int2 view) { return (1f / Zoom * view.ToFloat2()).ToInt2() + TopLeft; } @@ -142,7 +142,7 @@ namespace OpenRA.Graphics get { // Visible rectangle in world coordinates (expanded to the corners of the cells) - var map = worldRenderer.world.Map; + var map = worldRenderer.World.Map; var ctl = map.CenterOfCell(VisibleCells.TopLeft) - new WVec(512, 512, 0); var cbr = map.CenterOfCell(VisibleCells.BottomRight) + new WVec(512, 512, 0); @@ -159,7 +159,7 @@ namespace OpenRA.Graphics { if (cellsDirty) { - var map = worldRenderer.world.Map; + var map = worldRenderer.World.Map; var wtl = worldRenderer.Position(TopLeft); var wbr = worldRenderer.Position(BottomRight); diff --git a/OpenRA.Game/Graphics/VoxelLoader.cs b/OpenRA.Game/Graphics/VoxelLoader.cs index 41b259832a..b32a80d00a 100644 --- a/OpenRA.Game/Graphics/VoxelLoader.cs +++ b/OpenRA.Game/Graphics/VoxelLoader.cs @@ -86,16 +86,16 @@ namespace OpenRA.Graphics var s = sheetBuilder.Allocate(new Size(su, sv)); Util.FastCopyIntoChannel(s, 0, colors); Util.FastCopyIntoChannel(s, 1, normals); - s.sheet.CommitData(); + s.Sheet.CommitData(); - var channelP = ChannelSelect[(int)s.channel]; - var channelC = ChannelSelect[(int)s.channel + 1]; + var channelP = ChannelSelect[(int)s.Channel]; + var channelC = ChannelSelect[(int)s.Channel + 1]; return new Vertex[4] { - new Vertex(coord(0, 0), s.left, s.top, channelP, channelC), - new Vertex(coord(su, 0), s.right, s.top, channelP, channelC), - new Vertex(coord(su, sv), s.right, s.bottom, channelP, channelC), - new Vertex(coord(0, sv), s.left, s.bottom, channelP, channelC) + new Vertex(coord(0, 0), s.Left, s.Top, channelP, channelC), + new Vertex(coord(su, 0), s.Right, s.Top, channelP, channelC), + new Vertex(coord(su, sv), s.Right, s.Bottom, channelP, channelC), + new Vertex(coord(0, sv), s.Left, s.Bottom, channelP, channelC) }; } diff --git a/OpenRA.Game/Graphics/VoxelProvider.cs b/OpenRA.Game/Graphics/VoxelProvider.cs index 669a56d550..c89bbeb470 100644 --- a/OpenRA.Game/Graphics/VoxelProvider.cs +++ b/OpenRA.Game/Graphics/VoxelProvider.cs @@ -30,7 +30,7 @@ namespace OpenRA.Graphics foreach (var s in sequences) LoadVoxelsForUnit(s.Key, s.Value); - Game.modData.VoxelLoader.RefreshBuffer(); + Game.ModData.VoxelLoader.RefreshBuffer(); } static Voxel LoadVoxel(string unit, MiniYaml info) @@ -47,12 +47,12 @@ namespace OpenRA.Graphics hva = fields[1].Trim(); } - return Game.modData.VoxelLoader.Load(vxl, hva); + return Game.ModData.VoxelLoader.Load(vxl, hva); } static void LoadVoxelsForUnit(string unit, MiniYaml sequences) { - Game.modData.LoadScreen.Display(); + Game.ModData.LoadScreen.Display(); try { var seq = sequences.ToDictionary(my => LoadVoxel(unit, my)); diff --git a/OpenRA.Game/Graphics/VoxelRenderer.cs b/OpenRA.Game/Graphics/VoxelRenderer.cs index d74d557b78..c1585c04eb 100644 --- a/OpenRA.Game/Graphics/VoxelRenderer.cs +++ b/OpenRA.Game/Graphics/VoxelRenderer.cs @@ -161,8 +161,8 @@ namespace OpenRA.Graphics var sprite = sheetBuilder.Allocate(spriteSize, spriteOffset); var shadowSprite = sheetBuilder.Allocate(shadowSpriteSize, shadowSpriteOffset); - var sb = sprite.bounds; - var ssb = shadowSprite.bounds; + var sb = sprite.Bounds; + var ssb = shadowSprite.Bounds; var spriteCenter = new float2(sb.Left + sb.Width / 2, sb.Top + sb.Height / 2); var shadowCenter = new float2(ssb.Left + ssb.Width / 2, ssb.Top + ssb.Height / 2); @@ -171,7 +171,7 @@ namespace OpenRA.Graphics var correctionTransform = Util.MatrixMultiply(translateMtx, FlipMtx); var shadowCorrectionTransform = Util.MatrixMultiply(shadowTranslateMtx, ShadowScaleFlipMtx); - doRender.Add(Pair.New(sprite.sheet, () => + doRender.Add(Pair.New(sprite.Sheet, () => { foreach (var v in voxels) { @@ -262,7 +262,7 @@ namespace OpenRA.Graphics shader.SetVec("AmbientLight", ambientLight, 3); shader.SetVec("DiffuseLight", diffuseLight, 3); - shader.Render(() => renderer.DrawBatch(Game.modData.VoxelLoader.VertexBuffer, renderData.Start, renderData.Count, PrimitiveType.QuadList)); + shader.Render(() => renderer.DrawBatch(Game.ModData.VoxelLoader.VertexBuffer, renderData.Start, renderData.Count, PrimitiveType.QuadList)); } public void BeginFrame() diff --git a/OpenRA.Game/Graphics/WorldRenderer.cs b/OpenRA.Game/Graphics/WorldRenderer.cs index c721172370..072adf1635 100644 --- a/OpenRA.Game/Graphics/WorldRenderer.cs +++ b/OpenRA.Game/Graphics/WorldRenderer.cs @@ -31,7 +31,7 @@ namespace OpenRA.Graphics public sealed class WorldRenderer : IDisposable { - public readonly World world; + public readonly World World; public readonly Theater Theater; public Viewport Viewport { get; private set; } @@ -42,10 +42,10 @@ namespace OpenRA.Graphics internal WorldRenderer(World world) { - this.world = world; + World = world; Viewport = new Viewport(this, world.Map); - foreach (var pal in world.traitDict.ActorsWithTrait()) + foreach (var pal in world.TraitDict.ActorsWithTrait()) pal.Trait.LoadPalettes(this); palette.Initialize(); @@ -70,27 +70,27 @@ namespace OpenRA.Graphics List GenerateRenderables() { var comparer = new RenderableComparer(this); - var actors = world.ScreenMap.ActorsInBox(Viewport.TopLeft, Viewport.BottomRight) - .Append(world.WorldActor) + var actors = World.ScreenMap.ActorsInBox(Viewport.TopLeft, Viewport.BottomRight) + .Append(World.WorldActor) .ToList(); // Include player actor for the rendered player - if (world.RenderPlayer != null) - actors.Add(world.RenderPlayer.PlayerActor); + if (World.RenderPlayer != null) + actors.Add(World.RenderPlayer.PlayerActor); var worldRenderables = actors.SelectMany(a => a.Render(this)); - if (world.OrderGenerator != null) - worldRenderables = worldRenderables.Concat(world.OrderGenerator.Render(this, world)); + if (World.OrderGenerator != null) + worldRenderables = worldRenderables.Concat(World.OrderGenerator.Render(this, World)); worldRenderables = worldRenderables.OrderBy(r => r, comparer); // Effects are drawn on top of all actors // HACK: Effects aren't interleaved with actors. - var effectRenderables = world.Effects + var effectRenderables = World.Effects .SelectMany(e => e.Render(this)); - if (world.OrderGenerator != null) - effectRenderables = effectRenderables.Concat(world.OrderGenerator.RenderAfterWorld(this, world)); + if (World.OrderGenerator != null) + effectRenderables = effectRenderables.Concat(World.OrderGenerator.RenderAfterWorld(this, World)); // Iterating via foreach copies the structs, so enumerate by index var renderables = worldRenderables.Concat(effectRenderables).ToList(); @@ -107,7 +107,7 @@ namespace OpenRA.Graphics { RefreshPalette(); - if (world.IsShellmap && !Game.Settings.Game.ShowShellmap) + if (World.IsShellmap && !Game.Settings.Game.ShowShellmap) return; var renderables = GenerateRenderables(); @@ -121,13 +121,13 @@ namespace OpenRA.Graphics renderables[i].Render(this); // added for contrails - foreach (var a in world.ActorsWithTrait()) + foreach (var a in World.ActorsWithTrait()) if (a.Actor.IsInWorld && !a.Actor.Destroyed) a.Trait.RenderAfterWorld(this, a.Actor); - var renderShroud = world.RenderPlayer != null ? world.RenderPlayer.Shroud : null; + var renderShroud = World.RenderPlayer != null ? World.RenderPlayer.Shroud : null; - foreach (var a in world.ActorsWithTrait()) + foreach (var a in World.ActorsWithTrait()) a.Trait.RenderShroud(this, renderShroud); if (devTrait.Value != null && devTrait.Value.ShowDebugGeometry) @@ -136,7 +136,7 @@ namespace OpenRA.Graphics Game.Renderer.DisableScissor(); - var overlayRenderables = world.Selection.Actors.Where(a => !a.Destroyed) + var overlayRenderables = World.Selection.Actors.Where(a => !a.Destroyed) .SelectMany(a => a.TraitsImplementing()) .SelectMany(t => t.RenderAfterWorld(this)) .ToList(); @@ -156,12 +156,12 @@ namespace OpenRA.Graphics foreach (var r in g) r.RenderDebugGeometry(this); - if (!world.IsShellmap && Game.Settings.Game.AlwaysShowStatusBars) + if (!World.IsShellmap && Game.Settings.Game.AlwaysShowStatusBars) { - foreach (var g in world.Actors.Where(a => !a.Destroyed + foreach (var g in World.Actors.Where(a => !a.Destroyed && a.HasTrait() - && !world.FogObscures(a) - && !world.Selection.Actors.Contains(a))) + && !World.FogObscures(a) + && !World.Selection.Actors.Contains(a))) DrawRollover(g); } @@ -206,14 +206,14 @@ namespace OpenRA.Graphics public void RefreshPalette() { - palette.ApplyModifiers(world.WorldActor.TraitsImplementing()); + palette.ApplyModifiers(World.WorldActor.TraitsImplementing()); Game.Renderer.SetPalette(palette); } // Conversion between world and screen coordinates public float2 ScreenPosition(WPos pos) { - var ts = Game.modData.Manifest.TileSize; + var ts = Game.ModData.Manifest.TileSize; return new float2(ts.Width * pos.X / 1024f, ts.Height * (pos.Y - pos.Z) / 1024f); } @@ -227,7 +227,7 @@ namespace OpenRA.Graphics // For scaling vectors to pixel sizes in the voxel renderer public float[] ScreenVector(WVec vec) { - var ts = Game.modData.Manifest.TileSize; + var ts = Game.ModData.Manifest.TileSize; return new float[] { ts.Width * vec.X / 1024f, ts.Height * vec.Y / 1024f, ts.Height * vec.Z / 1024f, 1 }; } @@ -240,13 +240,13 @@ namespace OpenRA.Graphics public float ScreenZPosition(WPos pos, int offset) { - var ts = Game.modData.Manifest.TileSize; + var ts = Game.ModData.Manifest.TileSize; return (pos.Y + pos.Z + offset) * ts.Height / 1024f; } public WPos Position(int2 screenPx) { - var ts = Game.modData.Manifest.TileSize; + var ts = Game.ModData.Manifest.TileSize; return new WPos(1024 * screenPx.X / ts.Width, 1024 * screenPx.Y / ts.Height, 0); } diff --git a/OpenRA.Game/Map/ActorInitializer.cs b/OpenRA.Game/Map/ActorInitializer.cs index 903aed6284..d0f374b547 100755 --- a/OpenRA.Game/Map/ActorInitializer.cs +++ b/OpenRA.Game/Map/ActorInitializer.cs @@ -16,19 +16,19 @@ namespace OpenRA { public class ActorInitializer { - public readonly Actor self; - public World world { get { return self.World; } } + public readonly Actor Self; + public World World { get { return Self.World; } } internal TypeDictionary Dict; public ActorInitializer(Actor actor, TypeDictionary dict) { - self = actor; + Self = actor; Dict = dict; } public T Get() where T : IActorInit { return Dict.Get(); } - public U Get() where T : IActorInit { return Dict.Get().Value(world); } + public U Get() where T : IActorInit { return Dict.Get().Value(World); } public bool Contains() where T : IActorInit { return Dict.Contains(); } } diff --git a/OpenRA.Game/Map/Map.cs b/OpenRA.Game/Map/Map.cs index 900f71d678..5efc58fe10 100644 --- a/OpenRA.Game/Map/Map.cs +++ b/OpenRA.Game/Map/Map.cs @@ -204,7 +204,7 @@ namespace OpenRA public static Map FromTileset(TileSet tileset) { var size = new Size(1, 1); - var tileShape = Game.modData.Manifest.TileShape; + var tileShape = Game.ModData.Manifest.TileShape; var tileRef = new TerrainTile(tileset.Templates.First().Key, (byte)0); var makeMapTiles = Exts.Lazy(() => @@ -328,10 +328,10 @@ namespace OpenRA MapResources = Exts.Lazy(() => LoadResourceTiles()); MapHeight = Exts.Lazy(() => LoadMapHeight()); - TileShape = Game.modData.Manifest.TileShape; - SubCellOffsets = Game.modData.Manifest.SubCellOffsets; + TileShape = Game.ModData.Manifest.TileShape; + SubCellOffsets = Game.ModData.Manifest.SubCellOffsets; LastSubCell = (SubCell)(SubCellOffsets.Length - 1); - DefaultSubCell = (SubCell)Game.modData.Manifest.SubCellDefaultIndex; + DefaultSubCell = (SubCell)Game.ModData.Manifest.SubCellDefaultIndex; if (Container.Exists("map.png")) using (var dataStream = Container.GetContent("map.png")) @@ -354,7 +354,7 @@ namespace OpenRA { try { - return Game.modData.RulesetCache.LoadMapRules(this); + return Game.ModData.RulesetCache.LoadMapRules(this); } catch (Exception e) { @@ -362,7 +362,7 @@ namespace OpenRA Log.Write("debug", "Failed to load rules for {0} with error {1}", Title, e.Message); } - return Game.modData.DefaultRules; + return Game.ModData.DefaultRules; }); cachedTileSet = Exts.Lazy(() => Rules.TileSets[Tileset]); diff --git a/OpenRA.Game/Map/MapPreview.cs b/OpenRA.Game/Map/MapPreview.cs index eb18d418a5..e740812f48 100644 --- a/OpenRA.Game/Map/MapPreview.cs +++ b/OpenRA.Game/Map/MapPreview.cs @@ -167,7 +167,7 @@ namespace OpenRA return; Status = MapStatus.Downloading; - var baseMapPath = Platform.ResolvePath("^", "maps", Game.modData.Manifest.Mod.Id); + var baseMapPath = Platform.ResolvePath("^", "maps", Game.ModData.Manifest.Mod.Id); // Create the map directory if it doesn't exist if (!Directory.Exists(baseMapPath)) diff --git a/OpenRA.Game/Network/GameServer.cs b/OpenRA.Game/Network/GameServer.cs index 1bd78f6780..d96b8fad41 100644 --- a/OpenRA.Game/Network/GameServer.cs +++ b/OpenRA.Game/Network/GameServer.cs @@ -49,7 +49,7 @@ namespace OpenRA.Network else ModLabel = "Unknown mod: {0}".F(Mods); - var mapAvailable = Game.Settings.Game.AllowDownloading || Game.modData.MapCache[Map].Status == MapStatus.Available; + var mapAvailable = Game.Settings.Game.AllowDownloading || Game.ModData.MapCache[Map].Status == MapStatus.Available; IsJoinable = IsCompatible && State == 1 && mapAvailable; } } diff --git a/OpenRA.Game/Network/ReplayRecorderConnection.cs b/OpenRA.Game/Network/ReplayRecorderConnection.cs index 86ff1eadc4..3842700c94 100644 --- a/OpenRA.Game/Network/ReplayRecorderConnection.cs +++ b/OpenRA.Game/Network/ReplayRecorderConnection.cs @@ -47,7 +47,7 @@ namespace OpenRA.Network void StartSavingReplay(byte[] initialContent) { var filename = chooseFilename(); - var mod = Game.modData.Manifest.Mod; + var mod = Game.ModData.Manifest.Mod; var dir = Platform.ResolvePath("^", "Replays", mod.Id, mod.Version); if (!Directory.Exists(dir)) diff --git a/OpenRA.Game/Network/SyncReport.cs b/OpenRA.Game/Network/SyncReport.cs index 096d6a898a..6b682f2df5 100644 --- a/OpenRA.Game/Network/SyncReport.cs +++ b/OpenRA.Game/Network/SyncReport.cs @@ -101,7 +101,7 @@ namespace OpenRA.Network { if (r.Frame == frame) { - var mod = Game.modData.Manifest.Mod; + var mod = Game.ModData.Manifest.Mod; Log.Write("sync", "Player: {0} ({1} {2} {3})", Game.Settings.Player.Name, Platform.CurrentPlatform, Environment.OSVersion, Platform.RuntimeVersion); Log.Write("sync", "Game ID: {0} (Mod: {1} at Version {2})", orderManager.LobbyInfo.GlobalSettings.GameUid, mod.Title, mod.Version); Log.Write("sync", "Sync for net frame {0} -------------", r.Frame); diff --git a/OpenRA.Game/Network/UnitOrders.cs b/OpenRA.Game/Network/UnitOrders.cs index 7a88bd5c18..359e59e486 100644 --- a/OpenRA.Game/Network/UnitOrders.cs +++ b/OpenRA.Game/Network/UnitOrders.cs @@ -93,7 +93,7 @@ namespace OpenRA.Network case "StartGame": { - if (Game.modData.MapCache[orderManager.LobbyInfo.GlobalSettings.Map].Status != MapStatus.Available) + if (Game.ModData.MapCache[orderManager.LobbyInfo.GlobalSettings.Map].Status != MapStatus.Available) { Game.Disconnect(); Game.LoadShellMap(); @@ -129,7 +129,7 @@ namespace OpenRA.Network case "HandshakeRequest": { // Switch to the server's mod if we need and are able to - var mod = Game.modData.Manifest.Mod; + var mod = Game.ModData.Manifest.Mod; var request = HandshakeRequest.Deserialize(order.TargetString); ModMetadata serverMod; @@ -142,7 +142,7 @@ namespace OpenRA.Network "Launch.Replay=" + replay.Filename : "Launch.Connect=" + orderManager.Host + ":" + orderManager.Port; - Game.modData.LoadScreen.Display(); + Game.ModData.LoadScreen.Display(); Game.InitializeMod(request.Mod, new Arguments(launchCommand)); break; @@ -261,7 +261,7 @@ namespace OpenRA.Network case "SetStance": { - if (!Game.orderManager.LobbyInfo.GlobalSettings.FragileAlliances) + if (!Game.OrderManager.LobbyInfo.GlobalSettings.FragileAlliances) return; var targetPlayer = order.Player.World.Players.FirstOrDefault(p => p.InternalName == order.TargetString); diff --git a/OpenRA.Game/Scripting/ScriptActorInterface.cs b/OpenRA.Game/Scripting/ScriptActorInterface.cs index a269c0094f..8a07a0c068 100644 --- a/OpenRA.Game/Scripting/ScriptActorInterface.cs +++ b/OpenRA.Game/Scripting/ScriptActorInterface.cs @@ -38,13 +38,13 @@ namespace OpenRA.Scripting void InitializeBindings() { - var commandClasses = context.ActorCommands[actor.Info].AsEnumerable(); + var commandClasses = Context.ActorCommands[actor.Info].AsEnumerable(); // Destroyed actors cannot have their traits queried if (actor.Destroyed) commandClasses = commandClasses.Where(c => c.HasAttribute()); - var args = new object[] { context, actor }; + var args = new object[] { Context, actor }; var objects = commandClasses.Select(cg => { var groupCtor = cg.GetConstructor(new Type[] { typeof(ScriptContext), typeof(Actor) }); diff --git a/OpenRA.Game/Scripting/ScriptContext.cs b/OpenRA.Game/Scripting/ScriptContext.cs index 83ae4246d6..d0b27c6606 100644 --- a/OpenRA.Game/Scripting/ScriptContext.cs +++ b/OpenRA.Game/Scripting/ScriptContext.cs @@ -47,23 +47,23 @@ namespace OpenRA.Scripting public abstract class ScriptActorProperties { - protected readonly Actor self; - protected readonly ScriptContext context; + protected readonly Actor Self; + protected readonly ScriptContext Context; public ScriptActorProperties(ScriptContext context, Actor self) { - this.self = self; - this.context = context; + Self = self; + Context = context; } } public abstract class ScriptPlayerProperties { - protected readonly Player player; - protected readonly ScriptContext context; + protected readonly Player Player; + protected readonly ScriptContext Context; public ScriptPlayerProperties(ScriptContext context, Player player) { - this.player = player; - this.context = context; + Player = player; + Context = context; } } @@ -123,12 +123,12 @@ namespace OpenRA.Scripting World = world; WorldRenderer = worldRenderer; - knownActorCommands = Game.modData.ObjectCreator + knownActorCommands = Game.ModData.ObjectCreator .GetTypesImplementing() .ToArray(); ActorCommands = new Cache(FilterActorCommands); - PlayerCommands = Game.modData.ObjectCreator + PlayerCommands = Game.ModData.ObjectCreator .GetTypesImplementing() .ToArray(); @@ -148,7 +148,7 @@ namespace OpenRA.Scripting registerGlobal.Call("print", fn).Dispose(); // Register global tables - var bindings = Game.modData.ObjectCreator.GetTypesImplementing(); + var bindings = Game.ModData.ObjectCreator.GetTypesImplementing(); foreach (var b in bindings) { var ctor = b.GetConstructors(BindingFlags.Public | BindingFlags.Instance).FirstOrDefault(c => diff --git a/OpenRA.Game/Scripting/ScriptObjectWrapper.cs b/OpenRA.Game/Scripting/ScriptObjectWrapper.cs index 5b40bcac41..6c48c84f09 100644 --- a/OpenRA.Game/Scripting/ScriptObjectWrapper.cs +++ b/OpenRA.Game/Scripting/ScriptObjectWrapper.cs @@ -19,12 +19,12 @@ namespace OpenRA.Scripting protected abstract string DuplicateKeyError(string memberName); protected abstract string MemberNotFoundError(string memberName); - protected readonly ScriptContext context; + protected readonly ScriptContext Context; Dictionary members; public ScriptObjectWrapper(ScriptContext context) { - this.context = context; + Context = context; } protected void Bind(IEnumerable clrObjects) @@ -38,7 +38,7 @@ namespace OpenRA.Scripting if (members.ContainsKey(m.Name)) throw new LuaException(DuplicateKeyError(m.Name)); - members.Add(m.Name, new ScriptMemberWrapper(context, obj, m)); + members.Add(m.Name, new ScriptMemberWrapper(Context, obj, m)); } } } diff --git a/OpenRA.Game/Sound/OpenAlSound.cs b/OpenRA.Game/Sound/OpenAlSound.cs index 9723140043..3e34210a84 100644 --- a/OpenRA.Game/Sound/OpenAlSound.cs +++ b/OpenRA.Game/Sound/OpenAlSound.cs @@ -148,7 +148,7 @@ namespace OpenRA return null; } - var currFrame = Game.orderManager.LocalFrameNumber; + var currFrame = Game.OrderManager.LocalFrameNumber; var atten = 1f; // Check if max # of instances-per-location reached: diff --git a/OpenRA.Game/Support/Program.cs b/OpenRA.Game/Support/Program.cs index 3105fc558d..a274a6f901 100644 --- a/OpenRA.Game/Support/Program.cs +++ b/OpenRA.Game/Support/Program.cs @@ -49,9 +49,9 @@ namespace OpenRA { Log.AddChannel("exception", "exception.log"); - if (Game.modData != null) + if (Game.ModData != null) { - var mod = Game.modData.Manifest.Mod; + var mod = Game.ModData.Manifest.Mod; Log.Write("exception", "{0} Mod at Version {1}", mod.Title, mod.Version); } diff --git a/OpenRA.Game/Traits/BodyOrientation.cs b/OpenRA.Game/Traits/BodyOrientation.cs index f51bb0fb4f..9a4dae8614 100644 --- a/OpenRA.Game/Traits/BodyOrientation.cs +++ b/OpenRA.Game/Traits/BodyOrientation.cs @@ -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 diff --git a/OpenRA.Game/Traits/DebugPauseState.cs b/OpenRA.Game/Traits/DebugPauseState.cs index 8631936cb2..4ed8affd09 100644 --- a/OpenRA.Game/Traits/DebugPauseState.cs +++ b/OpenRA.Game/Traits/DebugPauseState.cs @@ -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 diff --git a/OpenRA.Game/Traits/DrawLineToTarget.cs b/OpenRA.Game/Traits/DrawLineToTarget.cs index 0a253fd6ea..723191782c 100644 --- a/OpenRA.Game/Traits/DrawLineToTarget.cs +++ b/OpenRA.Game/Traits/DrawLineToTarget.cs @@ -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 diff --git a/OpenRA.Game/Traits/Player/FrozenActorLayer.cs b/OpenRA.Game/Traits/Player/FrozenActorLayer.cs index 5a33244f56..a4ee10723a 100644 --- a/OpenRA.Game/Traits/Player/FrozenActorLayer.cs +++ b/OpenRA.Game/Traits/Player/FrozenActorLayer.cs @@ -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 diff --git a/OpenRA.Game/Traits/Player/PlayerColorPalette.cs b/OpenRA.Game/Traits/Player/PlayerColorPalette.cs index 57e1309f79..9343d8a53a 100644 --- a/OpenRA.Game/Traits/Player/PlayerColorPalette.cs +++ b/OpenRA.Game/Traits/Player/PlayerColorPalette.cs @@ -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 diff --git a/OpenRA.Game/Traits/Player/PlayerHighlightPalette.cs b/OpenRA.Game/Traits/Player/PlayerHighlightPalette.cs index 63dd4f6fc3..26ad1900b8 100644 --- a/OpenRA.Game/Traits/Player/PlayerHighlightPalette.cs +++ b/OpenRA.Game/Traits/Player/PlayerHighlightPalette.cs @@ -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 diff --git a/OpenRA.Game/Traits/Player/PlayerResources.cs b/OpenRA.Game/Traits/Player/PlayerResources.cs index 11a2e10a01..0a7a087f0b 100644 --- a/OpenRA.Game/Traits/Player/PlayerResources.cs +++ b/OpenRA.Game/Traits/Player/PlayerResources.cs @@ -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 diff --git a/OpenRA.Game/Traits/Selectable.cs b/OpenRA.Game/Traits/Selectable.cs index e5bdb87a2a..986abf23e5 100644 --- a/OpenRA.Game/Traits/Selectable.cs +++ b/OpenRA.Game/Traits/Selectable.cs @@ -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 diff --git a/OpenRA.Game/Traits/SelectionDecorations.cs b/OpenRA.Game/Traits/SelectionDecorations.cs index 1aa303b6de..3f518d5204 100644 --- a/OpenRA.Game/Traits/SelectionDecorations.cs +++ b/OpenRA.Game/Traits/SelectionDecorations.cs @@ -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 diff --git a/OpenRA.Game/Traits/World/ActorMap.cs b/OpenRA.Game/Traits/World/ActorMap.cs index 4df7cf2d48..619cf01d31 100644 --- a/OpenRA.Game/Traits/World/ActorMap.cs +++ b/OpenRA.Game/Traits/World/ActorMap.cs @@ -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 diff --git a/OpenRA.Game/Traits/World/ResourceType.cs b/OpenRA.Game/Traits/World/ResourceType.cs index 9b983a39a5..b6aff6e0c2 100644 --- a/OpenRA.Game/Traits/World/ResourceType.cs +++ b/OpenRA.Game/Traits/World/ResourceType.cs @@ -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 diff --git a/OpenRA.Game/Traits/World/ScreenMap.cs b/OpenRA.Game/Traits/World/ScreenMap.cs old mode 100755 new mode 100644 index 1e6b27f3c9..f11298e474 --- a/OpenRA.Game/Traits/World/ScreenMap.cs +++ b/OpenRA.Game/Traits/World/ScreenMap.cs @@ -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; diff --git a/OpenRA.Game/Traits/World/Shroud.cs b/OpenRA.Game/Traits/World/Shroud.cs index 2b7feebe85..f547b732b0 100644 --- a/OpenRA.Game/Traits/World/Shroud.cs +++ b/OpenRA.Game/Traits/World/Shroud.cs @@ -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 diff --git a/OpenRA.Game/Widgets/DropDownButtonWidget.cs b/OpenRA.Game/Widgets/DropDownButtonWidget.cs index 735d78130f..7371ef9652 100644 --- a/OpenRA.Game/Widgets/DropDownButtonWidget.cs +++ b/OpenRA.Game/Widgets/DropDownButtonWidget.cs @@ -43,7 +43,7 @@ namespace OpenRA.Widgets var color = GetColor(); var colorDisabled = GetColorDisabled(); - WidgetUtils.DrawRGBA(image, stateOffset + new float2(rb.Right - rb.Height + 4, rb.Top + (rb.Height - image.bounds.Height) / 2)); + WidgetUtils.DrawRGBA(image, stateOffset + new float2(rb.Right - rb.Height + 4, rb.Top + (rb.Height - image.Bounds.Height) / 2)); WidgetUtils.FillRectWithColor(new Rectangle(stateOffset.X + rb.Right - rb.Height, stateOffset.Y + rb.Top + 3, 1, rb.Height - 6), diff --git a/OpenRA.Game/Widgets/MapPreviewWidget.cs b/OpenRA.Game/Widgets/MapPreviewWidget.cs index 5e1292c15c..aed507f37f 100644 --- a/OpenRA.Game/Widgets/MapPreviewWidget.cs +++ b/OpenRA.Game/Widgets/MapPreviewWidget.cs @@ -132,7 +132,7 @@ namespace OpenRA.Widgets public int2 ConvertToPreview(CPos cell) { var preview = Preview(); - var tileShape = Game.modData.Manifest.TileShape; + var tileShape = Game.ModData.Manifest.TileShape; var point = Map.CellToMap(tileShape, cell); var dx = (int)(previewScale * (point.X - preview.Bounds.Left)); var dy = (int)(previewScale * (point.Y - preview.Bounds.Top)); @@ -152,9 +152,9 @@ namespace OpenRA.Widgets return; // Update map rect - previewScale = Math.Min(RenderBounds.Width / minimap.size.X, RenderBounds.Height / minimap.size.Y); - var w = (int)(previewScale * minimap.size.X); - var h = (int)(previewScale * minimap.size.Y); + previewScale = Math.Min(RenderBounds.Width / minimap.Size.X, RenderBounds.Height / minimap.Size.Y); + var w = (int)(previewScale * minimap.Size.X); + var h = (int)(previewScale * minimap.Size.Y); var x = RenderBounds.X + (RenderBounds.Width - w) / 2; var y = RenderBounds.Y + (RenderBounds.Height - h) / 2; mapRect = new Rectangle(x, y, w, h); @@ -172,10 +172,10 @@ namespace OpenRA.Widgets var owned = colors.ContainsKey(p); var pos = ConvertToPreview(p); var sprite = owned ? spawnClaimed : spawnUnclaimed; - var offset = new int2(sprite.bounds.Width, sprite.bounds.Height) / 2; + var offset = new int2(sprite.Bounds.Width, sprite.Bounds.Height) / 2; if (owned) - WidgetUtils.FillEllipseWithColor(new Rectangle(pos.X - offset.X + 1, pos.Y - offset.Y + 1, sprite.bounds.Width - 2, sprite.bounds.Height - 2), colors[p]); + WidgetUtils.FillEllipseWithColor(new Rectangle(pos.X - offset.X + 1, pos.Y - offset.Y + 1, sprite.Bounds.Width - 2, sprite.Bounds.Height - 2), colors[p]); Game.Renderer.RgbaSpriteRenderer.DrawSprite(sprite, pos - offset); var number = Convert.ToChar('A' + spawnPoints.IndexOf(p)).ToString(); diff --git a/OpenRA.Game/Widgets/RootWidget.cs b/OpenRA.Game/Widgets/RootWidget.cs index eb192f17c5..bdad4fd28d 100644 --- a/OpenRA.Game/Widgets/RootWidget.cs +++ b/OpenRA.Game/Widgets/RootWidget.cs @@ -27,7 +27,7 @@ namespace OpenRA.Widgets if (hk == Game.Settings.Keys.DevReloadChromeKey) { - ChromeProvider.Initialize(Game.modData.Manifest.Chrome); + ChromeProvider.Initialize(Game.ModData.Manifest.Chrome); return true; } } diff --git a/OpenRA.Game/Widgets/SliderWidget.cs b/OpenRA.Game/Widgets/SliderWidget.cs old mode 100755 new mode 100644 index 44442c2acc..1720ea1524 --- a/OpenRA.Game/Widgets/SliderWidget.cs +++ b/OpenRA.Game/Widgets/SliderWidget.cs @@ -118,7 +118,7 @@ namespace OpenRA.Widgets for (var i = 0; i < Ticks; i++) { var tickPos = new float2( - trackOrigin + (i * (trackRect.Width - (int)tick.size.X) / (Ticks - 1)) - tick.size.X / 2, + trackOrigin + (i * (trackRect.Width - (int)tick.Size.X) / (Ticks - 1)) - tick.Size.X / 2, trackRect.Bottom); WidgetUtils.DrawRGBA(tick, tickPos); diff --git a/OpenRA.Game/Widgets/SpriteSequenceWidget.cs b/OpenRA.Game/Widgets/SpriteSequenceWidget.cs index 4d323d567b..27ab93011d 100644 --- a/OpenRA.Game/Widgets/SpriteSequenceWidget.cs +++ b/OpenRA.Game/Widgets/SpriteSequenceWidget.cs @@ -36,7 +36,7 @@ namespace OpenRA.Widgets if (Unit != null && Sequence != null) { - var anim = new Animation(WorldRenderer.world, Unit, () => Facing); + var anim = new Animation(WorldRenderer.World, Unit, () => Facing); anim.PlayFetchIndex(Sequence, () => Frame); GetAnimation = () => anim; } diff --git a/OpenRA.Game/Widgets/SpriteWidget.cs b/OpenRA.Game/Widgets/SpriteWidget.cs index a875ac3a34..ea85c00427 100644 --- a/OpenRA.Game/Widgets/SpriteWidget.cs +++ b/OpenRA.Game/Widgets/SpriteWidget.cs @@ -56,7 +56,7 @@ namespace OpenRA.Widgets if (sprite != cachedSprite) { - offset = 0.5f * (new float2(RenderBounds.Size) - sprite.size); + offset = 0.5f * (new float2(RenderBounds.Size) - sprite.Size); cachedSprite = sprite; } diff --git a/OpenRA.Game/Widgets/VqaPlayerWidget.cs b/OpenRA.Game/Widgets/VqaPlayerWidget.cs index 1ea729de04..f5e1d654b4 100644 --- a/OpenRA.Game/Widgets/VqaPlayerWidget.cs +++ b/OpenRA.Game/Widgets/VqaPlayerWidget.cs @@ -117,7 +117,7 @@ namespace OpenRA.Widgets while (nextFrame > video.CurrentFrame) { video.AdvanceFrame(); - videoSprite.sheet.GetTexture().SetData(video.FrameData); + videoSprite.Sheet.GetTexture().SetData(video.FrameData); skippedFrames++; } @@ -185,7 +185,7 @@ namespace OpenRA.Widgets paused = true; Sound.StopVideo(); video.Reset(); - videoSprite.sheet.GetTexture().SetData(video.FrameData); + videoSprite.Sheet.GetTexture().SetData(video.FrameData); world.AddFrameEndTask(_ => onComplete()); } } diff --git a/OpenRA.Game/Widgets/Widget.cs b/OpenRA.Game/Widgets/Widget.cs index 80fd2edc47..75bfb606b8 100644 --- a/OpenRA.Game/Widgets/Widget.cs +++ b/OpenRA.Game/Widgets/Widget.cs @@ -44,7 +44,7 @@ namespace OpenRA.Widgets public static Widget OpenWindow(string id, WidgetArgs args) { - var window = Game.modData.WidgetLoader.LoadWidget(args, Root, id); + var window = Game.ModData.WidgetLoader.LoadWidget(args, Root, id); if (WindowList.Count > 0) Root.RemoveChild(WindowList.Peek()); WindowList.Push(window); @@ -67,7 +67,7 @@ namespace OpenRA.Widgets public static Widget LoadWidget(string id, Widget parent, WidgetArgs args) { - return Game.modData.WidgetLoader.LoadWidget(args, parent, id); + return Game.ModData.WidgetLoader.LoadWidget(args, parent, id); } public static void Tick() { Root.TickOuter(); } @@ -235,7 +235,7 @@ namespace OpenRA.Widgets args["widget"] = this; - LogicObject = Game.modData.ObjectCreator.CreateObject(Logic, args); + LogicObject = Game.ModData.ObjectCreator.CreateObject(Logic, args); args.Remove("widget"); } diff --git a/OpenRA.Game/Widgets/WidgetLoader.cs b/OpenRA.Game/Widgets/WidgetLoader.cs index 123cfb2780..8254a20694 100644 --- a/OpenRA.Game/Widgets/WidgetLoader.cs +++ b/OpenRA.Game/Widgets/WidgetLoader.cs @@ -74,7 +74,7 @@ namespace OpenRA static Widget NewWidget(string widgetType, WidgetArgs args) { widgetType = widgetType.Split('@')[0]; - return Game.modData.ObjectCreator.CreateObject(widgetType + "Widget", args); + return Game.ModData.ObjectCreator.CreateObject(widgetType + "Widget", args); } } } \ No newline at end of file diff --git a/OpenRA.Game/Widgets/WidgetUtils.cs b/OpenRA.Game/Widgets/WidgetUtils.cs index f3c13e790b..6ed711cd4f 100644 --- a/OpenRA.Game/Widgets/WidgetUtils.cs +++ b/OpenRA.Game/Widgets/WidgetUtils.cs @@ -29,33 +29,33 @@ namespace OpenRA.Widgets public static void DrawSHPCentered(Sprite s, float2 pos, WorldRenderer wr) { - Game.Renderer.SpriteRenderer.DrawSprite(s, pos - 0.5f * s.size, wr.Palette("chrome")); + Game.Renderer.SpriteRenderer.DrawSprite(s, pos - 0.5f * s.Size, wr.Palette("chrome")); } public static void DrawSHPCentered(Sprite s, float2 pos, WorldRenderer wr, float scale) { - Game.Renderer.SpriteRenderer.DrawSprite(s, pos - 0.5f * scale * s.size, wr.Palette("chrome"), scale * s.size); + Game.Renderer.SpriteRenderer.DrawSprite(s, pos - 0.5f * scale * s.Size, wr.Palette("chrome"), scale * s.Size); } - public static void DrawPanel(string collection, Rectangle Bounds) + public static void DrawPanel(string collection, Rectangle bounds) { - DrawPanelPartial(collection, Bounds, PanelSides.All); + DrawPanelPartial(collection, bounds, PanelSides.All); } public static void FillRectWithSprite(Rectangle r, Sprite s) { - for (var x = r.Left; x < r.Right; x += (int)s.size.X) - for (var y = r.Top; y < r.Bottom; y += (int)s.size.Y) + for (var x = r.Left; x < r.Right; x += (int)s.Size.X) + for (var y = r.Top; y < r.Bottom; y += (int)s.Size.Y) { var ss = s; var left = new int2(r.Right - x, r.Bottom - y); - if (left.X < (int)s.size.X || left.Y < (int)s.size.Y) + if (left.X < (int)s.Size.X || left.Y < (int)s.Size.Y) { - var rr = new Rectangle(s.bounds.Left, - s.bounds.Top, - Math.Min(left.X, (int)s.size.X), - Math.Min(left.Y, (int)s.size.Y)); - ss = new Sprite(s.sheet, rr, s.channel); + var rr = new Rectangle(s.Bounds.Left, + s.Bounds.Top, + Math.Min(left.X, (int)s.Size.X), + Math.Min(left.Y, (int)s.Size.Y)); + ss = new Sprite(s.Sheet, rr, s.Channel); } DrawRGBA(ss, new float2(x, y)); @@ -76,7 +76,7 @@ namespace OpenRA.Widgets { var images = new[] { "border-t", "border-b", "border-l", "border-r" }; var ss = images.Select(i => ChromeProvider.GetImage(collection, i)).ToArray(); - return new[] { (int)ss[0].size.Y, (int)ss[1].size.Y, (int)ss[2].size.X, (int)ss[3].size.X }; + return new[] { (int)ss[0].Size.Y, (int)ss[1].Size.Y, (int)ss[2].Size.X, (int)ss[3].Size.X }; } static bool HasFlags(this PanelSides a, PanelSides b) { return (a & b) == b; } @@ -95,10 +95,10 @@ namespace OpenRA.Widgets public static void DrawPanelPartial(Sprite[] ss, Rectangle bounds, PanelSides ps) { - var marginLeft = ss[2] == null ? 0 : (int)ss[2].size.X; - var marginTop = ss[0] == null ? 0 : (int)ss[0].size.Y; - var marginRight = ss[3] == null ? 0 : (int)ss[3].size.X; - var marginBottom = ss[1] == null ? 0 : (int)ss[1].size.Y; + var marginLeft = ss[2] == null ? 0 : (int)ss[2].Size.X; + var marginTop = ss[0] == null ? 0 : (int)ss[0].Size.Y; + var marginRight = ss[3] == null ? 0 : (int)ss[3].Size.X; + var marginBottom = ss[1] == null ? 0 : (int)ss[1].Size.Y; var marginWidth = marginRight + marginLeft; var marginHeight = marginBottom + marginTop; @@ -135,11 +135,11 @@ namespace OpenRA.Widgets if (ps.HasFlags(PanelSides.Left | PanelSides.Top) && ss[4] != null) DrawRGBA(ss[4], new float2(bounds.Left, bounds.Top)); if (ps.HasFlags(PanelSides.Right | PanelSides.Top) && ss[5] != null) - DrawRGBA(ss[5], new float2(bounds.Right - ss[5].size.X, bounds.Top)); + DrawRGBA(ss[5], new float2(bounds.Right - ss[5].Size.X, bounds.Top)); if (ps.HasFlags(PanelSides.Left | PanelSides.Bottom) && ss[6] != null) - DrawRGBA(ss[6], new float2(bounds.Left, bounds.Bottom - ss[6].size.Y)); + DrawRGBA(ss[6], new float2(bounds.Left, bounds.Bottom - ss[6].Size.Y)); if (ps.HasFlags(PanelSides.Right | PanelSides.Bottom) && ss[7] != null) - DrawRGBA(ss[7], new float2(bounds.Right - ss[7].size.X, bounds.Bottom - ss[7].size.Y)); + DrawRGBA(ss[7], new float2(bounds.Right - ss[7].Size.X, bounds.Bottom - ss[7].Size.Y)); } public static string FormatTime(int ticks) @@ -215,7 +215,7 @@ namespace OpenRA.Widgets public static string ChooseInitialMap(string initialUid) { - if (string.IsNullOrEmpty(initialUid) || Game.modData.MapCache[initialUid].Status != MapStatus.Available) + if (string.IsNullOrEmpty(initialUid) || Game.ModData.MapCache[initialUid].Status != MapStatus.Available) { Func isIdealMap = m => { @@ -237,8 +237,8 @@ namespace OpenRA.Widgets return true; }; - var selected = Game.modData.MapCache.Where(m => isIdealMap(m)).RandomOrDefault(Game.CosmeticRandom) ?? - Game.modData.MapCache.First(m => m.Status == MapStatus.Available && m.Map.Visibility.HasFlag(MapVisibility.Lobby)); + var selected = Game.ModData.MapCache.Where(m => isIdealMap(m)).RandomOrDefault(Game.CosmeticRandom) ?? + Game.ModData.MapCache.First(m => m.Status == MapStatus.Available && m.Map.Visibility.HasFlag(MapVisibility.Lobby)); return selected.Uid; } diff --git a/OpenRA.Game/World.cs b/OpenRA.Game/World.cs index 510d131dba..73f9b07f77 100644 --- a/OpenRA.Game/World.cs +++ b/OpenRA.Game/World.cs @@ -25,15 +25,15 @@ namespace OpenRA public class World { static readonly Func FalsePredicate = (u, v) => false; - internal readonly TraitDictionary traitDict = new TraitDictionary(); + internal readonly TraitDictionary TraitDict = new TraitDictionary(); readonly HashSet actors = new HashSet(); readonly List effects = new List(); readonly Queue> frameEndActions = new Queue>(); public int Timestep; - internal readonly OrderManager orderManager; - public Session LobbyInfo { get { return orderManager.LobbyInfo; } } + internal readonly OrderManager OrderManager; + public Session LobbyInfo { get { return OrderManager.LobbyInfo; } } public readonly MersenneTwister SharedRandom; @@ -87,7 +87,7 @@ namespace OpenRA public bool IsReplay { - get { return orderManager.Connection is ReplayConnection; } + get { return OrderManager.Connection is ReplayConnection; } } public bool AllowDevCommands @@ -111,20 +111,20 @@ namespace OpenRA public readonly ScreenMap ScreenMap; readonly GameInformation gameInfo; - public void IssueOrder(Order o) { orderManager.IssueOrder(o); } /* avoid exposing the OM to mod code */ + public void IssueOrder(Order o) { OrderManager.IssueOrder(o); } /* avoid exposing the OM to mod code */ - IOrderGenerator orderGenerator_; + IOrderGenerator orderGenerator; public IOrderGenerator OrderGenerator { get { - return orderGenerator_; + return orderGenerator; } set { Sync.AssertUnsynced("The current order generator may not be changed from synced code"); - orderGenerator_ = value; + orderGenerator = value; } } @@ -149,8 +149,8 @@ namespace OpenRA internal World(Map map, OrderManager orderManager, bool isShellmap) { IsShellmap = isShellmap; - this.orderManager = orderManager; - orderGenerator_ = new UnitOrderGenerator(); + OrderManager = orderManager; + orderGenerator = new UnitOrderGenerator(); Map = map; TileSet = map.Rules.TileSets[Map.Tileset]; @@ -189,9 +189,9 @@ namespace OpenRA gameInfo.StartTimeUtc = DateTime.UtcNow; foreach (var player in Players) - gameInfo.AddPlayer(player, orderManager.LobbyInfo); + gameInfo.AddPlayer(player, OrderManager.LobbyInfo); - var rc = orderManager.Connection as ReplayRecorderConnection; + var rc = OrderManager.Connection as ReplayRecorderConnection; if (rc != null) rc.Metadata = new ReplayMetadata(gameInfo); } @@ -330,7 +330,7 @@ namespace OpenRA public IEnumerable> ActorsWithTrait() { - return traitDict.ActorsWithTrait(); + return TraitDict.ActorsWithTrait(); } public void OnPlayerWinStateChanged(Player player) diff --git a/OpenRA.Mods.Cnc/Traits/AttackPopupTurreted.cs b/OpenRA.Mods.Cnc/Traits/AttackPopupTurreted.cs index 79e94fab59..035ba052c3 100644 --- a/OpenRA.Mods.Cnc/Traits/AttackPopupTurreted.cs +++ b/OpenRA.Mods.Cnc/Traits/AttackPopupTurreted.cs @@ -44,11 +44,11 @@ namespace OpenRA.Mods.Cnc.Traits bool skippedMakeAnimation; public AttackPopupTurreted(ActorInitializer init, AttackPopupTurretedInfo info) - : base(init.self, info) + : base(init.Self, info) { this.info = info; turret = turrets.FirstOrDefault(); - rb = init.self.Trait(); + rb = init.Self.Trait(); skippedMakeAnimation = init.Contains(); } diff --git a/OpenRA.Mods.Cnc/Traits/Buildings/ProductionAirdrop.cs b/OpenRA.Mods.Cnc/Traits/Buildings/ProductionAirdrop.cs index 25895f3041..489d2130c0 100644 --- a/OpenRA.Mods.Cnc/Traits/Buildings/ProductionAirdrop.cs +++ b/OpenRA.Mods.Cnc/Traits/Buildings/ProductionAirdrop.cs @@ -27,7 +27,7 @@ namespace OpenRA.Mods.Cnc.Traits [Desc("Cargo aircraft used.")] [ActorReference] public readonly string ActorType = "c17"; - public override object Create(ActorInitializer init) { return new ProductionAirdrop(this, init.self); } + public override object Create(ActorInitializer init) { return new ProductionAirdrop(this, init.Self); } } class ProductionAirdrop : Production diff --git a/OpenRA.Mods.Cnc/Traits/Buildings/TiberiumRefinery.cs b/OpenRA.Mods.Cnc/Traits/Buildings/TiberiumRefinery.cs index 34487f2a45..99fad3137f 100644 --- a/OpenRA.Mods.Cnc/Traits/Buildings/TiberiumRefinery.cs +++ b/OpenRA.Mods.Cnc/Traits/Buildings/TiberiumRefinery.cs @@ -17,7 +17,7 @@ namespace OpenRA.Mods.Cnc.Traits { public class TiberiumRefineryInfo : OreRefineryInfo { - public override object Create(ActorInitializer init) { return new TiberiumRefinery(init.self, this); } + public override object Create(ActorInitializer init) { return new TiberiumRefinery(init.Self, this); } } public class TiberiumRefinery : OreRefinery diff --git a/OpenRA.Mods.Cnc/Traits/Render/RenderGunboat.cs b/OpenRA.Mods.Cnc/Traits/Render/RenderGunboat.cs index fe6c4e3105..49fdd9a578 100644 --- a/OpenRA.Mods.Cnc/Traits/Render/RenderGunboat.cs +++ b/OpenRA.Mods.Cnc/Traits/Render/RenderGunboat.cs @@ -26,7 +26,7 @@ namespace OpenRA.Mods.Cnc.Traits public readonly string WakeLeftSequence = "wake-left"; public readonly string WakeRightSequence = "wake-right"; - public override object Create(ActorInitializer init) { return new RenderGunboat(init.self, this); } + public override object Create(ActorInitializer init) { return new RenderGunboat(init.Self, this); } public int QuantizedBodyFacings(SequenceProvider sequenceProvider, ActorInfo ai) { diff --git a/OpenRA.Mods.Cnc/Traits/Render/WithCargo.cs b/OpenRA.Mods.Cnc/Traits/Render/WithCargo.cs index 2931e7d628..c919f3978a 100644 --- a/OpenRA.Mods.Cnc/Traits/Render/WithCargo.cs +++ b/OpenRA.Mods.Cnc/Traits/Render/WithCargo.cs @@ -25,7 +25,7 @@ namespace OpenRA.Mods.Cnc.Traits [Desc("Passenger CargoType to display.")] public readonly string[] DisplayTypes = { }; - public object Create(ActorInitializer init) { return new WithCargo(init.self, this); } + public object Create(ActorInitializer init) { return new WithCargo(init.Self, this); } } public class WithCargo : IRenderModifier diff --git a/OpenRA.Mods.Cnc/Traits/Render/WithDeliveryAnimation.cs b/OpenRA.Mods.Cnc/Traits/Render/WithDeliveryAnimation.cs index f88522ac74..10d99eccf7 100644 --- a/OpenRA.Mods.Cnc/Traits/Render/WithDeliveryAnimation.cs +++ b/OpenRA.Mods.Cnc/Traits/Render/WithDeliveryAnimation.cs @@ -21,7 +21,7 @@ namespace OpenRA.Mods.Cnc.Traits public readonly string IdleSequence = "idle"; - public object Create(ActorInitializer init) { return new WithDeliveryAnimation(init.self, this); } + public object Create(ActorInitializer init) { return new WithDeliveryAnimation(init.Self, this); } } public class WithDeliveryAnimation : INotifyDelivery diff --git a/OpenRA.Mods.Cnc/Traits/Render/WithFire.cs b/OpenRA.Mods.Cnc/Traits/Render/WithFire.cs index 0bdeae941c..36d903081e 100644 --- a/OpenRA.Mods.Cnc/Traits/Render/WithFire.cs +++ b/OpenRA.Mods.Cnc/Traits/Render/WithFire.cs @@ -20,7 +20,7 @@ namespace OpenRA.Mods.Cnc.Traits public readonly string StartSequence = "fire-start"; public readonly string LoopSequence = "fire-loop"; - public object Create(ActorInitializer init) { return new WithFire(init.self, this); } + public object Create(ActorInitializer init) { return new WithFire(init.Self, this); } } class WithFire diff --git a/OpenRA.Mods.Cnc/Traits/Render/WithRoof.cs b/OpenRA.Mods.Cnc/Traits/Render/WithRoof.cs index a71e202bee..00446c5dea 100644 --- a/OpenRA.Mods.Cnc/Traits/Render/WithRoof.cs +++ b/OpenRA.Mods.Cnc/Traits/Render/WithRoof.cs @@ -19,7 +19,7 @@ namespace OpenRA.Mods.Cnc.Traits { public readonly string Sequence = "roof"; - public object Create(ActorInitializer init) { return new WithRoof(init.self, this); } + public object Create(ActorInitializer init) { return new WithRoof(init.Self, this); } } public class WithRoof diff --git a/OpenRA.Mods.Cnc/Traits/SupportPowers/IonCannonPower.cs b/OpenRA.Mods.Cnc/Traits/SupportPowers/IonCannonPower.cs index c156cc85a5..b54d2a7bcf 100644 --- a/OpenRA.Mods.Cnc/Traits/SupportPowers/IonCannonPower.cs +++ b/OpenRA.Mods.Cnc/Traits/SupportPowers/IonCannonPower.cs @@ -35,7 +35,7 @@ namespace OpenRA.Mods.Cnc.Traits [Desc("Apply the weapon impact this many ticks into the effect")] public readonly int WeaponDelay = 7; - public override object Create(ActorInitializer init) { return new IonCannonPower(init.self, this); } + public override object Create(ActorInitializer init) { return new IonCannonPower(init.Self, this); } } class IonCannonPower : SupportPower diff --git a/OpenRA.Mods.Common/Effects/Bullet.cs b/OpenRA.Mods.Common/Effects/Bullet.cs index ead6cde5ec..d48445bc76 100644 --- a/OpenRA.Mods.Common/Effects/Bullet.cs +++ b/OpenRA.Mods.Common/Effects/Bullet.cs @@ -150,7 +150,7 @@ namespace OpenRA.Mods.Common.Effects if (anim == null || ticks >= length) yield break; - var cell = wr.world.Map.CellContaining(pos); + var cell = wr.World.Map.CellContaining(pos); if (!args.SourceActor.World.FogObscures(cell)) { if (info.Shadow) diff --git a/OpenRA.Mods.Common/Effects/Contrail.cs b/OpenRA.Mods.Common/Effects/Contrail.cs index 7dbe73e3a7..8916326f82 100644 --- a/OpenRA.Mods.Common/Effects/Contrail.cs +++ b/OpenRA.Mods.Common/Effects/Contrail.cs @@ -31,7 +31,7 @@ namespace OpenRA.Mods.Common.Effects [Desc("Use player remap color instead of a custom color?")] public readonly bool UsePlayerColor = true; - public object Create(ActorInitializer init) { return new Contrail(init.self, this); } + public object Create(ActorInitializer init) { return new Contrail(init.Self, this); } } class Contrail : ITick, IRender diff --git a/OpenRA.Mods.Common/Effects/FloatingText.cs b/OpenRA.Mods.Common/Effects/FloatingText.cs index edc2a60118..0608f6c429 100644 --- a/OpenRA.Mods.Common/Effects/FloatingText.cs +++ b/OpenRA.Mods.Common/Effects/FloatingText.cs @@ -46,7 +46,7 @@ namespace OpenRA.Mods.Common.Effects public IEnumerable Render(WorldRenderer wr) { - if (wr.world.FogObscures(wr.world.Map.CellContaining(pos))) + if (wr.World.FogObscures(wr.World.Map.CellContaining(pos))) yield break; yield return new TextRenderable(font, pos, 0, color, text); diff --git a/OpenRA.Mods.Common/Effects/GravityBomb.cs b/OpenRA.Mods.Common/Effects/GravityBomb.cs index 71bc53bb5b..b4291b7308 100644 --- a/OpenRA.Mods.Common/Effects/GravityBomb.cs +++ b/OpenRA.Mods.Common/Effects/GravityBomb.cs @@ -65,7 +65,7 @@ namespace OpenRA.Mods.Common.Effects public IEnumerable Render(WorldRenderer wr) { - var cell = wr.world.Map.CellContaining(pos); + var cell = wr.World.Map.CellContaining(pos); if (!args.SourceActor.World.FogObscures(cell)) { if (info.Shadow) diff --git a/OpenRA.Mods.Common/Effects/LaserZap.cs b/OpenRA.Mods.Common/Effects/LaserZap.cs index 1edf07aa3c..ab050c5a87 100644 --- a/OpenRA.Mods.Common/Effects/LaserZap.cs +++ b/OpenRA.Mods.Common/Effects/LaserZap.cs @@ -83,8 +83,8 @@ namespace OpenRA.Mods.Common.Effects public IEnumerable Render(WorldRenderer wr) { - if (wr.world.FogObscures(wr.world.Map.CellContaining(target)) && - wr.world.FogObscures(wr.world.Map.CellContaining(args.Source))) + if (wr.World.FogObscures(wr.World.Map.CellContaining(target)) && + wr.World.FogObscures(wr.World.Map.CellContaining(args.Source))) yield break; if (ticks < info.BeamDuration) diff --git a/OpenRA.Mods.Common/Effects/Missile.cs b/OpenRA.Mods.Common/Effects/Missile.cs index ff55f25b66..e308391057 100644 --- a/OpenRA.Mods.Common/Effects/Missile.cs +++ b/OpenRA.Mods.Common/Effects/Missile.cs @@ -202,7 +202,7 @@ namespace OpenRA.Mods.Common.Effects if (info.ContrailLength > 0) yield return trail; - if (!args.SourceActor.World.FogObscures(wr.world.Map.CellContaining(pos))) + if (!args.SourceActor.World.FogObscures(wr.World.Map.CellContaining(pos))) { if (info.Shadow) { diff --git a/OpenRA.Mods.Common/Effects/PowerdownIndicator.cs b/OpenRA.Mods.Common/Effects/PowerdownIndicator.cs index b9dca8f7ce..5041628769 100644 --- a/OpenRA.Mods.Common/Effects/PowerdownIndicator.cs +++ b/OpenRA.Mods.Common/Effects/PowerdownIndicator.cs @@ -40,7 +40,7 @@ namespace OpenRA.Mods.Common.Effects public IEnumerable Render(WorldRenderer wr) { - if (a.Destroyed || wr.world.FogObscures(a)) + if (a.Destroyed || wr.World.FogObscures(a)) return SpriteRenderable.None; return anim.Render(a.CenterPosition, wr.Palette("chrome")); diff --git a/OpenRA.Mods.Common/Effects/RallyPointIndicator.cs b/OpenRA.Mods.Common/Effects/RallyPointIndicator.cs index 931381426d..e068722faa 100644 --- a/OpenRA.Mods.Common/Effects/RallyPointIndicator.cs +++ b/OpenRA.Mods.Common/Effects/RallyPointIndicator.cs @@ -61,7 +61,7 @@ namespace OpenRA.Mods.Common.Effects if (!building.IsInWorld || !building.World.Selection.Actors.Contains(building)) return SpriteRenderable.None; - var pos = wr.world.Map.CenterOfCell(cachedLocation); + var pos = wr.World.Map.CenterOfCell(cachedLocation); var palette = wr.Palette(palettePrefix + building.Owner.InternalName); return circles.Render(pos, palette).Concat(flag.Render(pos, palette)); } diff --git a/OpenRA.Mods.Common/Effects/Rank.cs b/OpenRA.Mods.Common/Effects/Rank.cs index e004e7062d..eb49f402d4 100644 --- a/OpenRA.Mods.Common/Effects/Rank.cs +++ b/OpenRA.Mods.Common/Effects/Rank.cs @@ -51,7 +51,7 @@ namespace OpenRA.Mods.Common.Effects if (!self.Owner.IsAlliedWith(self.World.RenderPlayer)) yield break; - if (wr.world.FogObscures(self)) + if (wr.World.FogObscures(self)) yield break; var pos = wr.ScreenPxPosition(self.CenterPosition); diff --git a/OpenRA.Mods.Common/Graphics/ActorPreview.cs b/OpenRA.Mods.Common/Graphics/ActorPreview.cs index 3d23a1e4d2..5f0cae9c97 100644 --- a/OpenRA.Mods.Common/Graphics/ActorPreview.cs +++ b/OpenRA.Mods.Common/Graphics/ActorPreview.cs @@ -26,7 +26,7 @@ namespace OpenRA.Mods.Common.Graphics public readonly ActorInfo Actor; public readonly Player Owner; public readonly WorldRenderer WorldRenderer; - public World World { get { return WorldRenderer.world; } } + public World World { get { return WorldRenderer.World; } } readonly TypeDictionary dict; diff --git a/OpenRA.Mods.Common/Graphics/ContrailRenderable.cs b/OpenRA.Mods.Common/Graphics/ContrailRenderable.cs index dd1cf9a8d2..9282466964 100644 --- a/OpenRA.Mods.Common/Graphics/ContrailRenderable.cs +++ b/OpenRA.Mods.Common/Graphics/ContrailRenderable.cs @@ -67,13 +67,13 @@ namespace OpenRA.Mods.Common.Graphics // Start of the first line segment is the tail of the list - don't smooth it. var curPos = trail[Index(next - skip - 1)]; - var curCell = wr.world.Map.CellContaining(curPos); + var curCell = wr.World.Map.CellContaining(curPos); var curColor = color; for (var i = 0; i < length - skip - 4; i++) { var j = next - skip - i - 2; var nextPos = Average(trail[Index(j)], trail[Index(j - 1)], trail[Index(j - 2)], trail[Index(j - 3)]); - var nextCell = wr.world.Map.CellContaining(nextPos); + var nextCell = wr.World.Map.CellContaining(nextPos); var nextColor = Exts.ColorLerp(i * 1f / (length - 4), color, Color.Transparent); if (!world.FogObscures(curCell) && !world.FogObscures(nextCell)) diff --git a/OpenRA.Mods.Common/Graphics/VoxelRenderable.cs b/OpenRA.Mods.Common/Graphics/VoxelRenderable.cs index 698db9ff31..be4ac2fb8f 100644 --- a/OpenRA.Mods.Common/Graphics/VoxelRenderable.cs +++ b/OpenRA.Mods.Common/Graphics/VoxelRenderable.cs @@ -101,9 +101,9 @@ namespace OpenRA.Mods.Common.Graphics public void Render(WorldRenderer wr) { // TODO: This is a temporary workaround until we have a proper ramp-aware height calculation - var groundPos = wr.world.Map.CenterOfCell(wr.world.Map.CellContaining(pos)); + var groundPos = wr.World.Map.CenterOfCell(wr.World.Map.CellContaining(pos)); - var ts = Game.modData.Manifest.TileSize; + var ts = Game.ModData.Manifest.TileSize; var groundZ = ts.Height * (groundPos.Z - pos.Z) / 1024f; var pxOrigin = wr.ScreenPosition(pos); @@ -115,7 +115,7 @@ namespace OpenRA.Mods.Common.Graphics var sc = shadowOrigin + psb[1]; var sd = shadowOrigin + psb[3]; Game.Renderer.WorldRgbaSpriteRenderer.DrawSprite(renderProxy.ShadowSprite, sa, sb, sc, sd); - Game.Renderer.WorldRgbaSpriteRenderer.DrawSprite(renderProxy.Sprite, pxOrigin - 0.5f * renderProxy.Sprite.size); + Game.Renderer.WorldRgbaSpriteRenderer.DrawSprite(renderProxy.Sprite, pxOrigin - 0.5f * renderProxy.Sprite.Size); } public void RenderDebugGeometry(WorldRenderer wr) @@ -125,8 +125,8 @@ namespace OpenRA.Mods.Common.Graphics var shadowOrigin = pxOrigin - groundZ * (new float2(renderProxy.ShadowDirection, 1)); // Draw sprite rect - var offset = pxOrigin + renderProxy.Sprite.offset - 0.5f * renderProxy.Sprite.size; - Game.Renderer.WorldLineRenderer.DrawRect(offset, offset + renderProxy.Sprite.size, Color.Red); + var offset = pxOrigin + renderProxy.Sprite.Offset - 0.5f * renderProxy.Sprite.Size; + Game.Renderer.WorldLineRenderer.DrawRect(offset, offset + renderProxy.Sprite.Size, Color.Red); // Draw transformed shadow sprite rect var c = Color.Purple; diff --git a/OpenRA.Mods.Common/LoadScreens/BlankLoadScreen.cs b/OpenRA.Mods.Common/LoadScreens/BlankLoadScreen.cs index d5ec770fb0..681ef3abd7 100644 --- a/OpenRA.Mods.Common/LoadScreens/BlankLoadScreen.cs +++ b/OpenRA.Mods.Common/LoadScreens/BlankLoadScreen.cs @@ -38,7 +38,7 @@ namespace OpenRA.Mods.Common.LoadScreens // Check whether the mod content is installed // TODO: The installation code has finally been beaten into shape, so we can // finally move it all into the planned "Manage Content" panel in the modchooser mod. - var installData = Game.modData.Manifest.ContentInstaller; + var installData = Game.ModData.Manifest.ContentInstaller; var installModContent = !installData.TestFiles.All(f => GlobalFileSystem.Exists(f)); var installModMusic = args != null && args.Contains("Install.Music"); diff --git a/OpenRA.Mods.Common/LoadScreens/ModChooserLoadScreen.cs b/OpenRA.Mods.Common/LoadScreens/ModChooserLoadScreen.cs index bfea1e2aee..f2dba57c4d 100644 --- a/OpenRA.Mods.Common/LoadScreens/ModChooserLoadScreen.cs +++ b/OpenRA.Mods.Common/LoadScreens/ModChooserLoadScreen.cs @@ -47,7 +47,7 @@ namespace OpenRA.Mods.Common.LoadScreens public void Dispose() { if (sprite != null) - sprite.sheet.Dispose(); + sprite.Sheet.Dispose(); } } } \ No newline at end of file diff --git a/OpenRA.Mods.Common/Scripting/Global/ActorGlobal.cs b/OpenRA.Mods.Common/Scripting/Global/ActorGlobal.cs index 227dc80b8e..069adc8c57 100644 --- a/OpenRA.Mods.Common/Scripting/Global/ActorGlobal.cs +++ b/OpenRA.Mods.Common/Scripting/Global/ActorGlobal.cs @@ -31,7 +31,7 @@ namespace OpenRA.Mods.Common.Scripting { // Find the requested type var typeName = kv.Key.ToString(); - var initType = Game.modData.ObjectCreator.FindType(typeName + "Init"); + var initType = Game.ModData.ObjectCreator.FindType(typeName + "Init"); if (initType == null) throw new LuaException("Unknown initializer type '{0}'".F(typeName)); @@ -52,9 +52,9 @@ namespace OpenRA.Mods.Common.Scripting } // The actor must be added to the world at the end of the tick - var a = context.World.CreateActor(false, type, initDict); + var a = Context.World.CreateActor(false, type, initDict); if (addToWorld) - context.World.AddFrameEndTask(w => w.Add(a)); + Context.World.AddFrameEndTask(w => w.Add(a)); return a; } @@ -63,7 +63,7 @@ namespace OpenRA.Mods.Common.Scripting public int BuildTime(string type) { ActorInfo ai; - if (!context.World.Map.Rules.Actors.TryGetValue(type, out ai)) + if (!Context.World.Map.Rules.Actors.TryGetValue(type, out ai)) throw new LuaException("Unknown actor type '{0}'".F(type)); return ai.GetBuildTime(); @@ -73,7 +73,7 @@ namespace OpenRA.Mods.Common.Scripting public int CruiseAltitude(string type) { ActorInfo ai; - if (!context.World.Map.Rules.Actors.TryGetValue(type, out ai)) + if (!Context.World.Map.Rules.Actors.TryGetValue(type, out ai)) throw new LuaException("Unknown actor type '{0}'".F(type)); var pi = ai.Traits.GetOrDefault(); diff --git a/OpenRA.Mods.Common/Scripting/Global/CameraGlobal.cs b/OpenRA.Mods.Common/Scripting/Global/CameraGlobal.cs index bafdc89ee0..e2a82d84c1 100644 --- a/OpenRA.Mods.Common/Scripting/Global/CameraGlobal.cs +++ b/OpenRA.Mods.Common/Scripting/Global/CameraGlobal.cs @@ -21,8 +21,8 @@ namespace OpenRA.Mods.Common.Scripting [Desc("The center of the visible viewport.")] public WPos Position { - get { return context.WorldRenderer.Viewport.CenterPosition; } - set { context.WorldRenderer.Viewport.Center(value); } + get { return Context.WorldRenderer.Viewport.CenterPosition; } + set { Context.WorldRenderer.Viewport.Center(value); } } } } diff --git a/OpenRA.Mods.Common/Scripting/Global/DateTimeGlobal.cs b/OpenRA.Mods.Common/Scripting/Global/DateTimeGlobal.cs index ddbbed0bee..7e350b2c81 100644 --- a/OpenRA.Mods.Common/Scripting/Global/DateTimeGlobal.cs +++ b/OpenRA.Mods.Common/Scripting/Global/DateTimeGlobal.cs @@ -29,7 +29,7 @@ namespace OpenRA.Mods.Common.Scripting [Desc("Get the current game time (in ticks)")] public int GameTime { - get { return context.World.WorldTick; } + get { return Context.World.WorldTick; } } [Desc("Converts the number of seconds into game time (ticks).")] diff --git a/OpenRA.Mods.Common/Scripting/Global/MapGlobal.cs b/OpenRA.Mods.Common/Scripting/Global/MapGlobal.cs index 32ea51a174..44d27e1016 100644 --- a/OpenRA.Mods.Common/Scripting/Global/MapGlobal.cs +++ b/OpenRA.Mods.Common/Scripting/Global/MapGlobal.cs @@ -32,13 +32,13 @@ namespace OpenRA.Mods.Common.Scripting [Desc("Returns a table of all actors within the requested region, filtered using the specified function.")] public Actor[] ActorsInCircle(WPos location, WRange radius, LuaFunction filter = null) { - var actors = context.World.FindActorsInCircle(location, radius); + var actors = Context.World.FindActorsInCircle(location, radius); if (filter != null) { actors = actors.Where(a => { - using (var f = filter.Call(a.ToLuaValue(context))) + using (var f = filter.Call(a.ToLuaValue(Context))) return f.First().ToBoolean(); }); } @@ -49,13 +49,13 @@ namespace OpenRA.Mods.Common.Scripting [Desc("Returns a table of all actors within the requested rectangle, filtered using the specified function.")] public Actor[] ActorsInBox(WPos topLeft, WPos bottomRight, LuaFunction filter = null) { - var actors = context.World.ActorMap.ActorsInBox(topLeft, bottomRight); + var actors = Context.World.ActorMap.ActorsInBox(topLeft, bottomRight); if (filter != null) { actors = actors.Where(a => { - using (var f = filter.Call(a.ToLuaValue(context))) + using (var f = filter.Call(a.ToLuaValue(Context))) return f.First().ToBoolean(); }); } @@ -66,38 +66,38 @@ namespace OpenRA.Mods.Common.Scripting [Desc("Returns the location of the top-left corner of the map.")] public WPos TopLeft { - get { return new WPos(context.World.Map.Bounds.Left * 1024, context.World.Map.Bounds.Top * 1024, 0); } + get { return new WPos(Context.World.Map.Bounds.Left * 1024, Context.World.Map.Bounds.Top * 1024, 0); } } [Desc("Returns the location of the bottom-right corner of the map.")] public WPos BottomRight { - get { return new WPos(context.World.Map.Bounds.Right * 1024, context.World.Map.Bounds.Bottom * 1024, 0); } + get { return new WPos(Context.World.Map.Bounds.Right * 1024, Context.World.Map.Bounds.Bottom * 1024, 0); } } [Desc("Returns a random cell inside the visible region of the map.")] public CPos RandomCell() { - return context.World.Map.ChooseRandomCell(context.World.SharedRandom); + return Context.World.Map.ChooseRandomCell(Context.World.SharedRandom); } [Desc("Returns a random cell on the visible border of the map.")] public CPos RandomEdgeCell() { - return context.World.Map.ChooseRandomEdgeCell(context.World.SharedRandom); + return Context.World.Map.ChooseRandomEdgeCell(Context.World.SharedRandom); } [Desc("Returns the center of a cell in world coordinates.")] public WPos CenterOfCell(CPos cell) { - return context.World.Map.CenterOfCell(cell); + return Context.World.Map.CenterOfCell(cell); } [Desc("Returns true if there is only one human player.")] - public bool IsSinglePlayer { get { return context.World.LobbyInfo.IsSinglePlayer; } } + public bool IsSinglePlayer { get { return Context.World.LobbyInfo.IsSinglePlayer; } } [Desc("Returns the difficulty selected by the player before starting the mission.")] - public string Difficulty { get { return context.World.LobbyInfo.GlobalSettings.Difficulty; } } + public string Difficulty { get { return Context.World.LobbyInfo.GlobalSettings.Difficulty; } } [Desc("Returns a table of all the actors that were specified in the map file.")] public Actor[] NamedActors { get { return sma.Actors.Values.ToArray(); } } diff --git a/OpenRA.Mods.Common/Scripting/Global/MediaGlobal.cs b/OpenRA.Mods.Common/Scripting/Global/MediaGlobal.cs index a54fcd03e0..0f41004b98 100644 --- a/OpenRA.Mods.Common/Scripting/Global/MediaGlobal.cs +++ b/OpenRA.Mods.Common/Scripting/Global/MediaGlobal.cs @@ -52,7 +52,7 @@ namespace OpenRA.Mods.Common.Scripting } catch (LuaException e) { - context.FatalError(e.Message); + Context.FatalError(e.Message); } }; } diff --git a/OpenRA.Mods.Common/Scripting/Global/PlayerGlobal.cs b/OpenRA.Mods.Common/Scripting/Global/PlayerGlobal.cs index db9a1ea08b..ccff679e34 100644 --- a/OpenRA.Mods.Common/Scripting/Global/PlayerGlobal.cs +++ b/OpenRA.Mods.Common/Scripting/Global/PlayerGlobal.cs @@ -22,16 +22,16 @@ namespace OpenRA.Mods.Common.Scripting [Desc("Returns the player with the specified internal name, or nil if a match is not found.")] public Player GetPlayer(string name) { - return context.World.Players.FirstOrDefault(p => p.InternalName == name); + return Context.World.Players.FirstOrDefault(p => p.InternalName == name); } [Desc("Returns a table of players filtered by the specified function.")] public Player[] GetPlayers(LuaFunction filter) { - return context.World.Players + return Context.World.Players .Where(p => { - using (var f = filter.Call(p.ToLuaValue(context))) + using (var f = filter.Call(p.ToLuaValue(Context))) return f.First().ToBoolean(); }).ToArray(); } diff --git a/OpenRA.Mods.Common/Scripting/Global/TriggerGlobal.cs b/OpenRA.Mods.Common/Scripting/Global/TriggerGlobal.cs index 8ef9785715..b80b71d19d 100644 --- a/OpenRA.Mods.Common/Scripting/Global/TriggerGlobal.cs +++ b/OpenRA.Mods.Common/Scripting/Global/TriggerGlobal.cs @@ -45,32 +45,32 @@ namespace OpenRA.Mods.Common.Scripting } catch (Exception e) { - context.FatalError(e.Message); + Context.FatalError(e.Message); } }; - context.World.AddFrameEndTask(w => w.Add(new DelayedAction(delay, doCall))); + Context.World.AddFrameEndTask(w => w.Add(new DelayedAction(delay, doCall))); } [Desc("Call a function each tick that the actor is idle. " + "The callback function will be called as func(Actor self).")] public void OnIdle(Actor a, LuaFunction func) { - GetScriptTriggers(a).RegisterCallback(Trigger.OnIdle, func, context); + GetScriptTriggers(a).RegisterCallback(Trigger.OnIdle, func, Context); } [Desc("Call a function when the actor is damaged. The callback " + "function will be called as func(Actor self, Actor attacker).")] public void OnDamaged(Actor a, LuaFunction func) { - GetScriptTriggers(a).RegisterCallback(Trigger.OnDamaged, func, context); + GetScriptTriggers(a).RegisterCallback(Trigger.OnDamaged, func, Context); } [Desc("Call a function when the actor is killed. The callback " + "function will be called as func(Actor self, Actor killer).")] public void OnKilled(Actor a, LuaFunction func) { - GetScriptTriggers(a).RegisterCallback(Trigger.OnKilled, func, context); + GetScriptTriggers(a).RegisterCallback(Trigger.OnKilled, func, Context); } [Desc("Call a function when all of the actors in a group are killed. The callback " + @@ -92,7 +92,7 @@ namespace OpenRA.Mods.Common.Scripting } catch (Exception e) { - context.FatalError(e.Message); + Context.FatalError(e.Message); } }; @@ -113,7 +113,7 @@ namespace OpenRA.Mods.Common.Scripting if (called) return; - using (var killed = m.ToLuaValue(context)) + using (var killed = m.ToLuaValue(Context)) copy.Call(killed).Dispose(); copy.Dispose(); @@ -121,7 +121,7 @@ namespace OpenRA.Mods.Common.Scripting } catch (Exception e) { - context.FatalError(e.Message); + Context.FatalError(e.Message); } }; @@ -133,56 +133,56 @@ namespace OpenRA.Mods.Common.Scripting "The callback function will be called as func(Actor producer, Actor produced).")] public void OnProduction(Actor a, LuaFunction func) { - GetScriptTriggers(a).RegisterCallback(Trigger.OnProduction, func, context); + GetScriptTriggers(a).RegisterCallback(Trigger.OnProduction, func, Context); } [Desc("Call a function when this player completes all primary objectives. " + "The callback function will be called as func(Player player).")] public void OnPlayerWon(Player player, LuaFunction func) { - GetScriptTriggers(player.PlayerActor).RegisterCallback(Trigger.OnPlayerWon, func, context); + GetScriptTriggers(player.PlayerActor).RegisterCallback(Trigger.OnPlayerWon, func, Context); } [Desc("Call a function when this player fails any primary objective. " + "The callback function will be called as func(Player player).")] public void OnPlayerLost(Player player, LuaFunction func) { - GetScriptTriggers(player.PlayerActor).RegisterCallback(Trigger.OnPlayerLost, func, context); + GetScriptTriggers(player.PlayerActor).RegisterCallback(Trigger.OnPlayerLost, func, Context); } [Desc("Call a function when this player is assigned a new objective. " + "The callback function will be called as func(Player player, int objectiveID).")] public void OnObjectiveAdded(Player player, LuaFunction func) { - GetScriptTriggers(player.PlayerActor).RegisterCallback(Trigger.OnObjectiveAdded, func, context); + GetScriptTriggers(player.PlayerActor).RegisterCallback(Trigger.OnObjectiveAdded, func, Context); } [Desc("Call a function when this player completes an objective. " + "The callback function will be called as func(Player player, int objectiveID).")] public void OnObjectiveCompleted(Player player, LuaFunction func) { - GetScriptTriggers(player.PlayerActor).RegisterCallback(Trigger.OnObjectiveCompleted, func, context); + GetScriptTriggers(player.PlayerActor).RegisterCallback(Trigger.OnObjectiveCompleted, func, Context); } [Desc("Call a function when this player fails an objective. " + "The callback function will be called as func(Player player, int objectiveID).")] public void OnObjectiveFailed(Player player, LuaFunction func) { - GetScriptTriggers(player.PlayerActor).RegisterCallback(Trigger.OnObjectiveFailed, func, context); + GetScriptTriggers(player.PlayerActor).RegisterCallback(Trigger.OnObjectiveFailed, func, Context); } [Desc("Call a function when this actor is added to the world. " + "The callback function will be called as func(Actor self).")] public void OnAddedToWorld(Actor a, LuaFunction func) { - GetScriptTriggers(a).RegisterCallback(Trigger.OnAddedToWorld, func, context); + GetScriptTriggers(a).RegisterCallback(Trigger.OnAddedToWorld, func, Context); } [Desc("Call a function when this actor is removed from the world. " + "The callback function will be called as func(Actor self).")] public void OnRemovedFromWorld(Actor a, LuaFunction func) { - GetScriptTriggers(a).RegisterCallback(Trigger.OnRemovedFromWorld, func, context); + GetScriptTriggers(a).RegisterCallback(Trigger.OnRemovedFromWorld, func, Context); } [Desc("Call a function when all of the actors in a group have been removed from the world. " + @@ -205,7 +205,7 @@ namespace OpenRA.Mods.Common.Scripting } catch (Exception e) { - context.FatalError(e.Message); + Context.FatalError(e.Message); } }; @@ -217,7 +217,7 @@ namespace OpenRA.Mods.Common.Scripting "will be called as func(Actor self, Actor captor, Player oldOwner, Player newOwner).")] public void OnCapture(Actor a, LuaFunction func) { - GetScriptTriggers(a).RegisterCallback(Trigger.OnCapture, func, context); + GetScriptTriggers(a).RegisterCallback(Trigger.OnCapture, func, Context); } [Desc("Call a function when this actor is killed or captured. " + @@ -240,7 +240,7 @@ namespace OpenRA.Mods.Common.Scripting } catch (Exception e) { - context.FatalError(e.Message); + Context.FatalError(e.Message); } }; @@ -271,7 +271,7 @@ namespace OpenRA.Mods.Common.Scripting } catch (Exception e) { - context.FatalError(e.Message); + Context.FatalError(e.Message); } }; @@ -293,17 +293,17 @@ namespace OpenRA.Mods.Common.Scripting { try { - using (var luaActor = a.ToLuaValue(context)) - using (var id = triggerId.ToLuaValue(context)) + using (var luaActor = a.ToLuaValue(Context)) + using (var id = triggerId.ToLuaValue(Context)) onEntry.Call(luaActor, id).Dispose(); } catch (Exception e) { - context.FatalError(e.Message); + Context.FatalError(e.Message); } }; - triggerId = context.World.ActorMap.AddCellTrigger(cells, invokeEntry, null); + triggerId = Context.World.ActorMap.AddCellTrigger(cells, invokeEntry, null); return triggerId; } @@ -319,17 +319,17 @@ namespace OpenRA.Mods.Common.Scripting { try { - using (var luaActor = a.ToLuaValue(context)) - using (var id = triggerId.ToLuaValue(context)) + using (var luaActor = a.ToLuaValue(Context)) + using (var id = triggerId.ToLuaValue(Context)) onExit.Call(luaActor, id).Dispose(); } catch (Exception e) { - context.FatalError(e.Message); + Context.FatalError(e.Message); } }; - triggerId = context.World.ActorMap.AddCellTrigger(cells, null, invokeExit); + triggerId = Context.World.ActorMap.AddCellTrigger(cells, null, invokeExit); return triggerId; } @@ -337,7 +337,7 @@ namespace OpenRA.Mods.Common.Scripting [Desc("Removes a previously created footprint trigger.")] public void RemoveFootprintTrigger(int id) { - context.World.ActorMap.RemoveCellTrigger(id); + Context.World.ActorMap.RemoveCellTrigger(id); } [Desc("Call a function when an actor enters this range." + @@ -351,17 +351,17 @@ namespace OpenRA.Mods.Common.Scripting { try { - using (var luaActor = a.ToLuaValue(context)) - using (var id = triggerId.ToLuaValue(context)) + using (var luaActor = a.ToLuaValue(Context)) + using (var id = triggerId.ToLuaValue(Context)) onEntry.Call(luaActor, id).Dispose(); } catch (Exception e) { - context.FatalError(e.Message); + Context.FatalError(e.Message); } }; - triggerId = context.World.ActorMap.AddProximityTrigger(pos, range, invokeEntry, null); + triggerId = Context.World.ActorMap.AddProximityTrigger(pos, range, invokeEntry, null); return triggerId; } @@ -377,17 +377,17 @@ namespace OpenRA.Mods.Common.Scripting { try { - using (var luaActor = a.ToLuaValue(context)) - using (var id = triggerId.ToLuaValue(context)) + using (var luaActor = a.ToLuaValue(Context)) + using (var id = triggerId.ToLuaValue(Context)) onExit.Call(luaActor, id).Dispose(); } catch (Exception e) { - context.FatalError(e.Message); + Context.FatalError(e.Message); } }; - triggerId = context.World.ActorMap.AddProximityTrigger(pos, range, null, invokeExit); + triggerId = Context.World.ActorMap.AddProximityTrigger(pos, range, null, invokeExit); return triggerId; } @@ -395,14 +395,14 @@ namespace OpenRA.Mods.Common.Scripting [Desc("Removes a previously created proximitry trigger.")] public void RemoveProximityTrigger(int id) { - context.World.ActorMap.RemoveProximityTrigger(id); + Context.World.ActorMap.RemoveProximityTrigger(id); } [Desc("Call a function when this actor is infiltrated. The callback function " + "will be called as func(Actor self, Actor infiltrator).")] public void OnInfiltrated(Actor a, LuaFunction func) { - GetScriptTriggers(a).RegisterCallback(Trigger.OnInfiltrated, func, context); + GetScriptTriggers(a).RegisterCallback(Trigger.OnInfiltrated, func, Context); } [Desc("Removes all triggers from this actor." + diff --git a/OpenRA.Mods.Common/Scripting/Global/UtilsGlobal.cs b/OpenRA.Mods.Common/Scripting/Global/UtilsGlobal.cs index 4b0d2f3a54..d7e05be642 100644 --- a/OpenRA.Mods.Common/Scripting/Global/UtilsGlobal.cs +++ b/OpenRA.Mods.Common/Scripting/Global/UtilsGlobal.cs @@ -62,7 +62,7 @@ namespace OpenRA.Mods.Common.Scripting [Desc("Skips over the first numElements members of a table and return the rest.")] public LuaTable Skip(LuaTable table, int numElements) { - var t = context.CreateTable(); + var t = Context.CreateTable(); for (var i = numElements; i <= table.Count; i++) t.Add(t.Count + 1, table[i]); @@ -73,7 +73,7 @@ namespace OpenRA.Mods.Common.Scripting [Desc("Returns a random value from a collection.")] public LuaValue Random(LuaValue[] collection) { - return collection.Random(context.World.SharedRandom); + return collection.Random(Context.World.SharedRandom); } [Desc("Expands the given footprint one step along the coordinate axes, and (if requested) diagonals.")] @@ -88,7 +88,7 @@ namespace OpenRA.Mods.Common.Scripting if (high <= low) return low; - return context.World.SharedRandom.Next(low, high); + return Context.World.SharedRandom.Next(low, high); } } } diff --git a/OpenRA.Mods.Common/Scripting/Properties/DiplomacyProperties.cs b/OpenRA.Mods.Common/Scripting/Properties/DiplomacyProperties.cs index 004c2af647..79d5cbcbc0 100644 --- a/OpenRA.Mods.Common/Scripting/Properties/DiplomacyProperties.cs +++ b/OpenRA.Mods.Common/Scripting/Properties/DiplomacyProperties.cs @@ -25,7 +25,7 @@ namespace OpenRA.Mods.Common.Scripting [Desc("Returns true if the player is allied with the other player.")] public bool IsAlliedWith(Player targetPlayer) { - return player.IsAlliedWith(targetPlayer); + return Player.IsAlliedWith(targetPlayer); } [Desc("Changes the current stance of the player against the target player. " + @@ -33,7 +33,7 @@ namespace OpenRA.Mods.Common.Scripting public void SetStance(Player targetPlayer, string newStance) { var emergingStance = Enum.Parse(newStance); - player.SetStance(targetPlayer, emergingStance); + Player.SetStance(targetPlayer, emergingStance); } } } \ No newline at end of file diff --git a/OpenRA.Mods.Common/Scripting/Properties/HealthProperties.cs b/OpenRA.Mods.Common/Scripting/Properties/HealthProperties.cs index 76c15ec2fd..767db393c5 100644 --- a/OpenRA.Mods.Common/Scripting/Properties/HealthProperties.cs +++ b/OpenRA.Mods.Common/Scripting/Properties/HealthProperties.cs @@ -27,7 +27,7 @@ namespace OpenRA.Mods.Common.Scripting public int Health { get { return health.HP; } - set { health.InflictDamage(self, self, health.HP - value, null, true); } + set { health.InflictDamage(Self, Self, health.HP - value, null, true); } } [Desc("Maximum health of the actor.")] @@ -36,7 +36,7 @@ namespace OpenRA.Mods.Common.Scripting [Desc("Kill the actor.")] public void Kill() { - health.InflictDamage(self, self, health.MaxHP, null, true); + health.InflictDamage(Self, Self, health.MaxHP, null, true); } } } diff --git a/OpenRA.Mods.Common/Scripting/Properties/UpgradeProperties.cs b/OpenRA.Mods.Common/Scripting/Properties/UpgradeProperties.cs index d6d62c29d7..92363889e5 100644 --- a/OpenRA.Mods.Common/Scripting/Properties/UpgradeProperties.cs +++ b/OpenRA.Mods.Common/Scripting/Properties/UpgradeProperties.cs @@ -27,25 +27,25 @@ namespace OpenRA.Mods.Common.Scripting [Desc("Grant an upgrade to this actor.")] public void GrantUpgrade(string upgrade) { - um.GrantUpgrade(self, upgrade, this); + um.GrantUpgrade(Self, upgrade, this); } [Desc("Revoke an upgrade that was previously granted using GrantUpgrade.")] public void RevokeUpgrade(string upgrade) { - um.RevokeUpgrade(self, upgrade, this); + um.RevokeUpgrade(Self, upgrade, this); } [Desc("Grant a limited-time upgrade to this actor.")] public void GrantTimedUpgrade(string upgrade, int duration) { - um.GrantTimedUpgrade(self, upgrade, duration); + um.GrantTimedUpgrade(Self, upgrade, duration); } [Desc("Check whether this actor accepts a specific upgrade.")] public bool AcceptsUpgrade(string upgrade) { - return um.AcceptsUpgrade(self, upgrade); + return um.AcceptsUpgrade(Self, upgrade); } } } \ No newline at end of file diff --git a/OpenRA.Mods.Common/Scripting/ScriptTriggers.cs b/OpenRA.Mods.Common/Scripting/ScriptTriggers.cs index 725453951d..9beaf343e7 100644 --- a/OpenRA.Mods.Common/Scripting/ScriptTriggers.cs +++ b/OpenRA.Mods.Common/Scripting/ScriptTriggers.cs @@ -24,7 +24,7 @@ namespace OpenRA.Mods.Common.Scripting [Desc("Allows map scripts to attach triggers to this actor via the Triggers global.")] public class ScriptTriggersInfo : ITraitInfo { - public object Create(ActorInitializer init) { return new ScriptTriggers(init.world); } + public object Create(ActorInitializer init) { return new ScriptTriggers(init.World); } } public sealed class ScriptTriggers : INotifyIdle, INotifyDamage, INotifyKilled, INotifyProduction, INotifyOtherProduction, INotifyObjectivesUpdated, INotifyCapture, INotifyInfiltrated, INotifyAddedToWorld, INotifyRemovedFromWorld, IDisposable diff --git a/OpenRA.Mods.Common/ServerTraits/LobbySettingsNotification.cs b/OpenRA.Mods.Common/ServerTraits/LobbySettingsNotification.cs index 28a0e3ba9a..2c18dbe975 100644 --- a/OpenRA.Mods.Common/ServerTraits/LobbySettingsNotification.cs +++ b/OpenRA.Mods.Common/ServerTraits/LobbySettingsNotification.cs @@ -23,7 +23,7 @@ namespace OpenRA.Mods.Common.Server return; var defaults = new Session.Global(); - FieldLoader.Load(defaults, Game.modData.Manifest.LobbyDefaults); + FieldLoader.Load(defaults, Game.ModData.Manifest.LobbyDefaults); if (server.LobbyInfo.GlobalSettings.FragileAlliances != defaults.FragileAlliances) server.SendOrderTo(conn, "Message", "Diplomacy Changes: {0}".F(server.LobbyInfo.GlobalSettings.FragileAlliances)); diff --git a/OpenRA.Mods.Common/Traits/Air/Aircraft.cs b/OpenRA.Mods.Common/Traits/Air/Aircraft.cs index e5c64bc9ee..de7dc915b1 100644 --- a/OpenRA.Mods.Common/Traits/Air/Aircraft.cs +++ b/OpenRA.Mods.Common/Traits/Air/Aircraft.cs @@ -61,7 +61,7 @@ namespace OpenRA.Mods.Common.Traits public Aircraft(ActorInitializer init, AircraftInfo info) { this.info = info; - this.self = init.self; + this.self = init.Self; if (init.Contains()) SetPosition(self, init.Get()); diff --git a/OpenRA.Mods.Common/Traits/Air/AttackBomber.cs b/OpenRA.Mods.Common/Traits/Air/AttackBomber.cs index 5259ff2fd0..74e606fe8d 100644 --- a/OpenRA.Mods.Common/Traits/Air/AttackBomber.cs +++ b/OpenRA.Mods.Common/Traits/Air/AttackBomber.cs @@ -24,7 +24,7 @@ namespace OpenRA.Mods.Common.Traits public readonly string Guns = "secondary"; public readonly int FacingTolerance = 2; - public override object Create(ActorInitializer init) { return new AttackBomber(init.self, this); } + public override object Create(ActorInitializer init) { return new AttackBomber(init.Self, this); } } public class AttackBomber : AttackBase, ITick, ISync, INotifyRemovedFromWorld diff --git a/OpenRA.Mods.Common/Traits/Air/AttackHeli.cs b/OpenRA.Mods.Common/Traits/Air/AttackHeli.cs index f03806c36d..964e57b4f4 100644 --- a/OpenRA.Mods.Common/Traits/Air/AttackHeli.cs +++ b/OpenRA.Mods.Common/Traits/Air/AttackHeli.cs @@ -16,7 +16,7 @@ namespace OpenRA.Mods.Common.Traits { public class AttackHeliInfo : AttackFrontalInfo { - public override object Create(ActorInitializer init) { return new AttackHeli(init.self, this); } + public override object Create(ActorInitializer init) { return new AttackHeli(init.Self, this); } } public class AttackHeli : AttackFrontal diff --git a/OpenRA.Mods.Common/Traits/Air/AttackPlane.cs b/OpenRA.Mods.Common/Traits/Air/AttackPlane.cs index 201a5a2f06..1d8d00f666 100644 --- a/OpenRA.Mods.Common/Traits/Air/AttackPlane.cs +++ b/OpenRA.Mods.Common/Traits/Air/AttackPlane.cs @@ -16,7 +16,7 @@ namespace OpenRA.Mods.Common.Traits { public class AttackPlaneInfo : AttackFrontalInfo { - public override object Create(ActorInitializer init) { return new AttackPlane(init.self, this); } + public override object Create(ActorInitializer init) { return new AttackPlane(init.Self, this); } } public class AttackPlane : AttackFrontal diff --git a/OpenRA.Mods.Common/Traits/Air/FallsToEarth.cs b/OpenRA.Mods.Common/Traits/Air/FallsToEarth.cs index bb6aa5efe1..a1ca29e5ef 100644 --- a/OpenRA.Mods.Common/Traits/Air/FallsToEarth.cs +++ b/OpenRA.Mods.Common/Traits/Air/FallsToEarth.cs @@ -25,7 +25,7 @@ namespace OpenRA.Mods.Common.Traits public readonly bool Moves = false; public readonly WRange Velocity = new WRange(43); - public object Create(ActorInitializer init) { return new FallsToEarth(init.self, this); } + public object Create(ActorInitializer init) { return new FallsToEarth(init.Self, this); } } public class FallsToEarth diff --git a/OpenRA.Mods.Common/Traits/Air/Helicopter.cs b/OpenRA.Mods.Common/Traits/Air/Helicopter.cs index 71fe64945b..4f297348f7 100644 --- a/OpenRA.Mods.Common/Traits/Air/Helicopter.cs +++ b/OpenRA.Mods.Common/Traits/Air/Helicopter.cs @@ -43,7 +43,7 @@ namespace OpenRA.Mods.Common.Traits public Helicopter(ActorInitializer init, HelicopterInfo info) : base(init, info) { - self = init.self; + self = init.Self; Info = info; } diff --git a/OpenRA.Mods.Common/Traits/Air/Plane.cs b/OpenRA.Mods.Common/Traits/Air/Plane.cs index 827894d70f..2db50c7cfc 100644 --- a/OpenRA.Mods.Common/Traits/Air/Plane.cs +++ b/OpenRA.Mods.Common/Traits/Air/Plane.cs @@ -33,7 +33,7 @@ namespace OpenRA.Mods.Common.Traits public Plane(ActorInitializer init, PlaneInfo info) : base(init, info) { - self = init.self; + self = init.Self; Info = info; } diff --git a/OpenRA.Mods.Common/Traits/Armament.cs b/OpenRA.Mods.Common/Traits/Armament.cs index a2b5902879..bc5db50657 100644 --- a/OpenRA.Mods.Common/Traits/Armament.cs +++ b/OpenRA.Mods.Common/Traits/Armament.cs @@ -53,7 +53,7 @@ namespace OpenRA.Mods.Common.Traits [Desc("Use multiple muzzle images if non-zero")] public readonly int MuzzleSplitFacings = 0; - public object Create(ActorInitializer init) { return new Armament(init.self, this); } + public object Create(ActorInitializer init) { return new Armament(init.Self, this); } } public class Armament : UpgradableTrait, ITick, IExplodeModifier diff --git a/OpenRA.Mods.Common/Traits/Attack/AttackCharge.cs b/OpenRA.Mods.Common/Traits/Attack/AttackCharge.cs index cff9d2a63d..5df85e0b1e 100644 --- a/OpenRA.Mods.Common/Traits/Attack/AttackCharge.cs +++ b/OpenRA.Mods.Common/Traits/Attack/AttackCharge.cs @@ -29,7 +29,7 @@ namespace OpenRA.Mods.Common.Traits [Desc("Delay between charge attacks (in ticks).")] public readonly int ChargeDelay = 3; - public override object Create(ActorInitializer init) { return new AttackCharge(init.self, this); } + public override object Create(ActorInitializer init) { return new AttackCharge(init.Self, this); } } class AttackCharge : AttackOmni, ITick, INotifyAttack, ISync diff --git a/OpenRA.Mods.Common/Traits/Attack/AttackFollow.cs b/OpenRA.Mods.Common/Traits/Attack/AttackFollow.cs index a797c51585..cce8a33933 100644 --- a/OpenRA.Mods.Common/Traits/Attack/AttackFollow.cs +++ b/OpenRA.Mods.Common/Traits/Attack/AttackFollow.cs @@ -17,7 +17,7 @@ namespace OpenRA.Mods.Common.Traits [Desc("Actor will follow units until in range to attack them.")] public class AttackFollowInfo : AttackBaseInfo { - public override object Create(ActorInitializer init) { return new AttackFollow(init.self, this); } + public override object Create(ActorInitializer init) { return new AttackFollow(init.Self, this); } } public class AttackFollow : AttackBase, ITick, ISync diff --git a/OpenRA.Mods.Common/Traits/Attack/AttackFrontal.cs b/OpenRA.Mods.Common/Traits/Attack/AttackFrontal.cs index 502f89b9c6..4f3cfb84cc 100644 --- a/OpenRA.Mods.Common/Traits/Attack/AttackFrontal.cs +++ b/OpenRA.Mods.Common/Traits/Attack/AttackFrontal.cs @@ -19,7 +19,7 @@ namespace OpenRA.Mods.Common.Traits { public readonly int FacingTolerance = 1; - public override object Create(ActorInitializer init) { return new AttackFrontal(init.self, this); } + public override object Create(ActorInitializer init) { return new AttackFrontal(init.Self, this); } } public class AttackFrontal : AttackBase diff --git a/OpenRA.Mods.Common/Traits/Attack/AttackMedic.cs b/OpenRA.Mods.Common/Traits/Attack/AttackMedic.cs index c9d4451a3f..1197a19079 100644 --- a/OpenRA.Mods.Common/Traits/Attack/AttackMedic.cs +++ b/OpenRA.Mods.Common/Traits/Attack/AttackMedic.cs @@ -18,7 +18,7 @@ namespace OpenRA.Mods.Common.Traits "heal process then. It also won't work with buildings (use RepairsUnits: for them)")] public class AttackMedicInfo : AttackFrontalInfo { - public override object Create(ActorInitializer init) { return new AttackMedic(init.self, this); } + public override object Create(ActorInitializer init) { return new AttackMedic(init.Self, this); } } public class AttackMedic : AttackFrontal diff --git a/OpenRA.Mods.Common/Traits/Attack/AttackOmni.cs b/OpenRA.Mods.Common/Traits/Attack/AttackOmni.cs index 34532bbf58..cafc87402b 100644 --- a/OpenRA.Mods.Common/Traits/Attack/AttackOmni.cs +++ b/OpenRA.Mods.Common/Traits/Attack/AttackOmni.cs @@ -15,7 +15,7 @@ namespace OpenRA.Mods.Common.Traits { class AttackOmniInfo : AttackBaseInfo { - public override object Create(ActorInitializer init) { return new AttackOmni(init.self, this); } + public override object Create(ActorInitializer init) { return new AttackOmni(init.Self, this); } } class AttackOmni : AttackBase, ISync diff --git a/OpenRA.Mods.Common/Traits/Attack/AttackTurreted.cs b/OpenRA.Mods.Common/Traits/Attack/AttackTurreted.cs index b8e70abefc..b4ea423f9f 100644 --- a/OpenRA.Mods.Common/Traits/Attack/AttackTurreted.cs +++ b/OpenRA.Mods.Common/Traits/Attack/AttackTurreted.cs @@ -17,7 +17,7 @@ namespace OpenRA.Mods.Common.Traits [Desc("Actor has a visual turret used to attack.")] public class AttackTurretedInfo : AttackFollowInfo, Requires { - public override object Create(ActorInitializer init) { return new AttackTurreted(init.self, this); } + public override object Create(ActorInitializer init) { return new AttackTurreted(init.Self, this); } } public class AttackTurreted : AttackFollow, ITick, ISync diff --git a/OpenRA.Mods.Common/Traits/Attack/AttackWander.cs b/OpenRA.Mods.Common/Traits/Attack/AttackWander.cs index 37fc2bf09d..5fa3c3bd7e 100644 --- a/OpenRA.Mods.Common/Traits/Attack/AttackWander.cs +++ b/OpenRA.Mods.Common/Traits/Attack/AttackWander.cs @@ -16,7 +16,7 @@ namespace OpenRA.Mods.Common.Traits "This conflicts with player orders and should only be added to animal creeps.")] class AttackWanderInfo : WandersInfo, Requires { - public override object Create(ActorInitializer init) { return new AttackWander(init.self, this); } + public override object Create(ActorInitializer init) { return new AttackWander(init.Self, this); } } class AttackWander : Wanders diff --git a/OpenRA.Mods.Common/Traits/AttackMove.cs b/OpenRA.Mods.Common/Traits/AttackMove.cs index 94cb9e5e27..cf34c8565b 100644 --- a/OpenRA.Mods.Common/Traits/AttackMove.cs +++ b/OpenRA.Mods.Common/Traits/AttackMove.cs @@ -18,7 +18,7 @@ namespace OpenRA.Mods.Common.Traits [Desc("Provides access to the attack-move command, which will make the actor automatically engage viable targets while moving to the destination.")] class AttackMoveInfo : ITraitInfo { - public object Create(ActorInitializer init) { return new AttackMove(init.self, this); } + public object Create(ActorInitializer init) { return new AttackMove(init.Self, this); } } class AttackMove : IResolveOrder, IOrderVoice, INotifyIdle, ISync diff --git a/OpenRA.Mods.Common/Traits/AutoTarget.cs b/OpenRA.Mods.Common/Traits/AutoTarget.cs index 24dbd852ec..14a0852b96 100644 --- a/OpenRA.Mods.Common/Traits/AutoTarget.cs +++ b/OpenRA.Mods.Common/Traits/AutoTarget.cs @@ -35,7 +35,7 @@ namespace OpenRA.Mods.Common.Traits public readonly bool TargetWhenIdle = true; public readonly bool TargetWhenDamaged = true; - public object Create(ActorInitializer init) { return new AutoTarget(init.self, this); } + public object Create(ActorInitializer init) { return new AutoTarget(init.Self, this); } } public enum UnitStance { HoldFire, ReturnFire, Defend, AttackAnything } diff --git a/OpenRA.Mods.Common/Traits/Buildings/BaseProvider.cs b/OpenRA.Mods.Common/Traits/Buildings/BaseProvider.cs index ec42be0ab1..628a294277 100644 --- a/OpenRA.Mods.Common/Traits/Buildings/BaseProvider.cs +++ b/OpenRA.Mods.Common/Traits/Buildings/BaseProvider.cs @@ -23,7 +23,7 @@ namespace OpenRA.Mods.Common.Traits public readonly int Cooldown = 0; public readonly int InitialDelay = 0; - public object Create(ActorInitializer init) { return new BaseProvider(init.self, this); } + public object Create(ActorInitializer init) { return new BaseProvider(init.Self, this); } } public class BaseProvider : ITick, IPostRenderSelection, ISelectionBar diff --git a/OpenRA.Mods.Common/Traits/Buildings/Bib.cs b/OpenRA.Mods.Common/Traits/Buildings/Bib.cs index 5b181d001e..afbb399a90 100644 --- a/OpenRA.Mods.Common/Traits/Buildings/Bib.cs +++ b/OpenRA.Mods.Common/Traits/Buildings/Bib.cs @@ -19,7 +19,7 @@ namespace OpenRA.Mods.Common.Traits public readonly string Palette = "terrain"; public readonly bool HasMinibib = false; - public object Create(ActorInitializer init) { return new Bib(init.self, this); } + public object Create(ActorInitializer init) { return new Bib(init.Self, this); } } public class Bib : INotifyAddedToWorld, INotifyRemovedFromWorld diff --git a/OpenRA.Mods.Common/Traits/Buildings/Building.cs b/OpenRA.Mods.Common/Traits/Buildings/Building.cs index 145d56a5a4..5686018ac1 100644 --- a/OpenRA.Mods.Common/Traits/Buildings/Building.cs +++ b/OpenRA.Mods.Common/Traits/Buildings/Building.cs @@ -127,14 +127,14 @@ namespace OpenRA.Mods.Common.Traits public Building(ActorInitializer init, BuildingInfo info) { - this.self = init.self; + this.self = init.Self; this.topLeft = init.Get(); this.Info = info; occupiedCells = FootprintUtils.UnpathableTiles(self.Info.Name, Info, TopLeft) .Select(c => Pair.New(c, SubCell.FullCell)).ToArray(); - CenterPosition = init.world.Map.CenterOfCell(topLeft) + FootprintUtils.CenterOffset(init.world, Info); + CenterPosition = init.World.Map.CenterOfCell(topLeft) + FootprintUtils.CenterOffset(init.World, Info); SkipMakeAnimation = init.Contains(); } diff --git a/OpenRA.Mods.Common/Traits/Buildings/BuildingInfluence.cs b/OpenRA.Mods.Common/Traits/Buildings/BuildingInfluence.cs index 2010f62407..9c90bd87b4 100644 --- a/OpenRA.Mods.Common/Traits/Buildings/BuildingInfluence.cs +++ b/OpenRA.Mods.Common/Traits/Buildings/BuildingInfluence.cs @@ -15,7 +15,7 @@ namespace OpenRA.Mods.Common.Traits [Desc("A dictionary of buildings placed on the map. Attach this to the world actor.")] public class BuildingInfluenceInfo : ITraitInfo { - public object Create(ActorInitializer init) { return new BuildingInfluence(init.world); } + public object Create(ActorInitializer init) { return new BuildingInfluence(init.World); } } public class BuildingInfluence diff --git a/OpenRA.Mods.Common/Traits/Buildings/DeadBuildingState.cs b/OpenRA.Mods.Common/Traits/Buildings/DeadBuildingState.cs index 61bc8327c1..5193dcab6d 100644 --- a/OpenRA.Mods.Common/Traits/Buildings/DeadBuildingState.cs +++ b/OpenRA.Mods.Common/Traits/Buildings/DeadBuildingState.cs @@ -17,7 +17,7 @@ namespace OpenRA.Mods.Common.Traits { public readonly int LingerTime = 20; - public object Create(ActorInitializer init) { return new DeadBuildingState(init.self, this); } + public object Create(ActorInitializer init) { return new DeadBuildingState(init.Self, this); } } class DeadBuildingState : INotifyKilled diff --git a/OpenRA.Mods.Common/Traits/Buildings/FreeActor.cs b/OpenRA.Mods.Common/Traits/Buildings/FreeActor.cs index 4ec3454057..ab0659ba20 100644 --- a/OpenRA.Mods.Common/Traits/Buildings/FreeActor.cs +++ b/OpenRA.Mods.Common/Traits/Buildings/FreeActor.cs @@ -38,13 +38,13 @@ namespace OpenRA.Mods.Common.Traits if (init.Contains() && !init.Get().ActorValue) return; - init.self.World.AddFrameEndTask(w => + init.Self.World.AddFrameEndTask(w => { var a = w.CreateActor(info.Actor, new TypeDictionary { - new ParentActorInit(init.self), - new LocationInit(init.self.Location + info.SpawnOffset), - new OwnerInit(init.self.Owner), + new ParentActorInit(init.Self), + new LocationInit(init.Self.Location + info.SpawnOffset), + new OwnerInit(init.Self.Owner), new FacingInit(info.Facing), }); diff --git a/OpenRA.Mods.Common/Traits/Buildings/RallyPoint.cs b/OpenRA.Mods.Common/Traits/Buildings/RallyPoint.cs index ed6a1dafe7..5efe70e3aa 100644 --- a/OpenRA.Mods.Common/Traits/Buildings/RallyPoint.cs +++ b/OpenRA.Mods.Common/Traits/Buildings/RallyPoint.cs @@ -20,7 +20,7 @@ namespace OpenRA.Mods.Common.Traits public readonly CVec RallyPoint = new CVec(1, 3); public readonly string IndicatorPalettePrefix = "player"; - public object Create(ActorInitializer init) { return new RallyPoint(init.self, this); } + public object Create(ActorInitializer init) { return new RallyPoint(init.Self, this); } } public class RallyPoint : IIssueOrder, IResolveOrder, ISync diff --git a/OpenRA.Mods.Common/Traits/Burns.cs b/OpenRA.Mods.Common/Traits/Burns.cs index f35d7dca53..475bbb4d19 100644 --- a/OpenRA.Mods.Common/Traits/Burns.cs +++ b/OpenRA.Mods.Common/Traits/Burns.cs @@ -20,7 +20,7 @@ namespace OpenRA.Mods.Common.Traits public readonly int Damage = 1; public readonly int Interval = 8; - public object Create(ActorInitializer init) { return new Burns(init.self, this); } + public object Create(ActorInitializer init) { return new Burns(init.Self, this); } } class Burns : ITick, ISync diff --git a/OpenRA.Mods.Common/Traits/Cargo.cs b/OpenRA.Mods.Common/Traits/Cargo.cs index f18aea17d4..0e97fba93f 100644 --- a/OpenRA.Mods.Common/Traits/Cargo.cs +++ b/OpenRA.Mods.Common/Traits/Cargo.cs @@ -53,7 +53,7 @@ namespace OpenRA.Mods.Common.Traits public Cargo(ActorInitializer init, CargoInfo info) { - self = init.self; + self = init.Self; Info = info; Unloading = false; diff --git a/OpenRA.Mods.Common/Traits/Cloak.cs b/OpenRA.Mods.Common/Traits/Cloak.cs index 5f22d59ca5..3a3151734e 100644 --- a/OpenRA.Mods.Common/Traits/Cloak.cs +++ b/OpenRA.Mods.Common/Traits/Cloak.cs @@ -38,7 +38,7 @@ namespace OpenRA.Mods.Common.Traits public readonly string[] CloakTypes = { "Cloak" }; - public object Create(ActorInitializer init) { return new Cloak(init.self, this); } + public object Create(ActorInitializer init) { return new Cloak(init.Self, this); } } public class Cloak : UpgradableTrait, IRenderModifier, INotifyDamageStateChanged, INotifyAttack, ITick, IVisibilityModifier, IRadarColorModifier diff --git a/OpenRA.Mods.Common/Traits/GainsExperience.cs b/OpenRA.Mods.Common/Traits/GainsExperience.cs index a4cf300aaf..1b3efcde37 100644 --- a/OpenRA.Mods.Common/Traits/GainsExperience.cs +++ b/OpenRA.Mods.Common/Traits/GainsExperience.cs @@ -70,7 +70,7 @@ namespace OpenRA.Mods.Common.Traits public GainsExperience(ActorInitializer init, GainsExperienceInfo info) { - self = init.self; + self = init.Self; this.info = info; MaxLevel = info.Upgrades.Count; diff --git a/OpenRA.Mods.Common/Traits/GivesExperience.cs b/OpenRA.Mods.Common/Traits/GivesExperience.cs index 82047a6e8b..bc328e1663 100644 --- a/OpenRA.Mods.Common/Traits/GivesExperience.cs +++ b/OpenRA.Mods.Common/Traits/GivesExperience.cs @@ -21,7 +21,7 @@ namespace OpenRA.Mods.Common.Traits [Desc("Grant experience for team-kills.")] public readonly bool FriendlyFire = false; - public object Create(ActorInitializer init) { return new GivesExperience(init.self, this); } + public object Create(ActorInitializer init) { return new GivesExperience(init.Self, this); } } class GivesExperience : INotifyKilled diff --git a/OpenRA.Mods.Common/Traits/GlobalUpgradable.cs b/OpenRA.Mods.Common/Traits/GlobalUpgradable.cs index 283650cba7..7888f45f11 100644 --- a/OpenRA.Mods.Common/Traits/GlobalUpgradable.cs +++ b/OpenRA.Mods.Common/Traits/GlobalUpgradable.cs @@ -18,7 +18,7 @@ namespace OpenRA.Mods.Common.Traits public readonly string[] Upgrades = { }; public readonly string[] Prerequisites = { }; - public object Create(ActorInitializer init) { return new GlobalUpgradable(init.self, this); } + public object Create(ActorInitializer init) { return new GlobalUpgradable(init.Self, this); } } public class GlobalUpgradable : INotifyAddedToWorld, INotifyRemovedFromWorld diff --git a/OpenRA.Mods.Common/Traits/Husk.cs b/OpenRA.Mods.Common/Traits/Husk.cs index 433ea9973f..b26ab045bb 100644 --- a/OpenRA.Mods.Common/Traits/Husk.cs +++ b/OpenRA.Mods.Common/Traits/Husk.cs @@ -43,14 +43,14 @@ namespace OpenRA.Mods.Common.Traits public Husk(ActorInitializer init, HuskInfo info) { this.info = info; - this.self = init.self; + this.self = init.Self; TopLeft = init.Get(); - CenterPosition = init.Contains() ? init.Get() : init.world.Map.CenterOfCell(TopLeft); + CenterPosition = init.Contains() ? init.Get() : init.World.Map.CenterOfCell(TopLeft); Facing = init.Contains() ? init.Get() : 128; dragSpeed = init.Contains() ? init.Get() : 0; - finalPosition = init.world.Map.CenterOfCell(TopLeft); + finalPosition = init.World.Map.CenterOfCell(TopLeft); } public void Created(Actor self) diff --git a/OpenRA.Mods.Common/Traits/Immobile.cs b/OpenRA.Mods.Common/Traits/Immobile.cs index d54d0e33c7..a6113ac51e 100644 --- a/OpenRA.Mods.Common/Traits/Immobile.cs +++ b/OpenRA.Mods.Common/Traits/Immobile.cs @@ -29,7 +29,7 @@ namespace OpenRA.Mods.Common.Traits public Immobile(ActorInitializer init, ImmobileInfo info) { location = init.Get(); - position = init.world.Map.CenterOfCell(location); + position = init.World.Map.CenterOfCell(location); if (info.OccupiesSpace) occupied = new[] { Pair.New(TopLeft, SubCell.FullCell) }; diff --git a/OpenRA.Mods.Common/Traits/Mobile.cs b/OpenRA.Mods.Common/Traits/Mobile.cs index 91e888e339..9aa16f0307 100644 --- a/OpenRA.Mods.Common/Traits/Mobile.cs +++ b/OpenRA.Mods.Common/Traits/Mobile.cs @@ -290,19 +290,19 @@ namespace OpenRA.Mods.Common.Traits public Mobile(ActorInitializer init, MobileInfo info) { - self = init.self; + self = init.Self; Info = info; - ToSubCell = FromSubCell = info.SharesCell ? init.world.Map.DefaultSubCell : SubCell.FullCell; + ToSubCell = FromSubCell = info.SharesCell ? init.World.Map.DefaultSubCell : SubCell.FullCell; if (init.Contains()) { - this.FromSubCell = this.ToSubCell = init.Get(); + FromSubCell = ToSubCell = init.Get(); } if (init.Contains()) { - this.fromCell = this.toCell = init.Get(); - SetVisualPosition(self, init.world.Map.CenterOfSubCell(FromCell, FromSubCell)); + fromCell = toCell = init.Get(); + SetVisualPosition(self, init.World.Map.CenterOfSubCell(FromCell, FromSubCell)); } this.Facing = init.Contains() ? init.Get() : info.InitialFacing; diff --git a/OpenRA.Mods.Common/Traits/Modifiers/FrozenUnderFog.cs b/OpenRA.Mods.Common/Traits/Modifiers/FrozenUnderFog.cs index ee77654721..956fd75cf5 100644 --- a/OpenRA.Mods.Common/Traits/Modifiers/FrozenUnderFog.cs +++ b/OpenRA.Mods.Common/Traits/Modifiers/FrozenUnderFog.cs @@ -44,15 +44,15 @@ namespace OpenRA.Mods.Common.Traits { // Spawned actors (e.g. building husks) shouldn't be revealed startsRevealed = info.StartsRevealed && !init.Contains(); - var footprint = FootprintUtils.Tiles(init.self).ToList(); - footprintInMapsCoords = footprint.Select(cell => Map.CellToMap(init.world.Map.TileShape, cell)).ToArray(); - footprintRegion = CellRegion.BoundingRegion(init.world.Map.TileShape, footprint); - tooltip = Exts.Lazy(() => init.self.TraitsImplementing().FirstOrDefault()); - tooltip = Exts.Lazy(() => init.self.TraitsImplementing().FirstOrDefault()); - health = Exts.Lazy(() => init.self.TraitOrDefault()); + var footprint = FootprintUtils.Tiles(init.Self).ToList(); + footprintInMapsCoords = footprint.Select(cell => Map.CellToMap(init.World.Map.TileShape, cell)).ToArray(); + footprintRegion = CellRegion.BoundingRegion(init.World.Map.TileShape, footprint); + tooltip = Exts.Lazy(() => init.Self.TraitsImplementing().FirstOrDefault()); + tooltip = Exts.Lazy(() => init.Self.TraitsImplementing().FirstOrDefault()); + health = Exts.Lazy(() => init.Self.TraitOrDefault()); frozen = new Dictionary(); - visible = init.world.Players.ToDictionary(p => p, p => false); + visible = init.World.Players.ToDictionary(p => p, p => false); } public bool IsVisible(Actor self, Player byPlayer) diff --git a/OpenRA.Mods.Common/Traits/PaletteEffects/WaterPaletteRotation.cs b/OpenRA.Mods.Common/Traits/PaletteEffects/WaterPaletteRotation.cs index 5db06757d9..50d60f48b0 100644 --- a/OpenRA.Mods.Common/Traits/PaletteEffects/WaterPaletteRotation.cs +++ b/OpenRA.Mods.Common/Traits/PaletteEffects/WaterPaletteRotation.cs @@ -20,7 +20,7 @@ namespace OpenRA.Mods.Common.Traits { public readonly string[] ExcludePalettes = { }; - public object Create(ActorInitializer init) { return new WaterPaletteRotation(init.world, this); } + public object Create(ActorInitializer init) { return new WaterPaletteRotation(init.World, this); } } class WaterPaletteRotation : ITick, IPaletteModifier diff --git a/OpenRA.Mods.Common/Traits/Player/ConquestVictoryConditions.cs b/OpenRA.Mods.Common/Traits/Player/ConquestVictoryConditions.cs index b366091797..a75b2e280b 100644 --- a/OpenRA.Mods.Common/Traits/Player/ConquestVictoryConditions.cs +++ b/OpenRA.Mods.Common/Traits/Player/ConquestVictoryConditions.cs @@ -18,7 +18,7 @@ namespace OpenRA.Mods.Common.Traits [Desc("Delay for the end game notification in milliseconds.")] public int NotificationDelay = 1500; - public object Create(ActorInitializer init) { return new ConquestVictoryConditions(init.self, this); } + public object Create(ActorInitializer init) { return new ConquestVictoryConditions(init.Self, this); } } public class ConquestVictoryConditions : ITick, INotifyObjectivesUpdated diff --git a/OpenRA.Mods.Common/Traits/Player/GlobalUpgradeManager.cs b/OpenRA.Mods.Common/Traits/Player/GlobalUpgradeManager.cs index 1a59bec2a0..3a1077454d 100644 --- a/OpenRA.Mods.Common/Traits/Player/GlobalUpgradeManager.cs +++ b/OpenRA.Mods.Common/Traits/Player/GlobalUpgradeManager.cs @@ -29,7 +29,7 @@ namespace OpenRA.Mods.Common.Traits public GlobalUpgradeManager(ActorInitializer init) { - self = init.self; + self = init.Self; techTree = self.Trait(); } diff --git a/OpenRA.Mods.Common/Traits/Player/MissionObjectives.cs b/OpenRA.Mods.Common/Traits/Player/MissionObjectives.cs index 82b805f7e3..29a785ad3b 100644 --- a/OpenRA.Mods.Common/Traits/Player/MissionObjectives.cs +++ b/OpenRA.Mods.Common/Traits/Player/MissionObjectives.cs @@ -48,7 +48,7 @@ namespace OpenRA.Mods.Common.Traits [Desc("Delay between the game over condition being met, and the game actually ending, in milliseconds.")] public readonly int GameOverDelay = 1500; - public object Create(ActorInitializer init) { return new MissionObjectives(init.world, this); } + public object Create(ActorInitializer init) { return new MissionObjectives(init.World, this); } } public class MissionObjectives : INotifyObjectivesUpdated, ISync, IResolveOrder diff --git a/OpenRA.Mods.Common/Traits/Player/PlaceBeacon.cs b/OpenRA.Mods.Common/Traits/Player/PlaceBeacon.cs index fa2fb76795..0d8f4bafab 100644 --- a/OpenRA.Mods.Common/Traits/Player/PlaceBeacon.cs +++ b/OpenRA.Mods.Common/Traits/Player/PlaceBeacon.cs @@ -20,7 +20,7 @@ namespace OpenRA.Mods.Common.Traits public readonly string Notification = "Beacon"; public readonly string PalettePrefix = "player"; - public object Create(ActorInitializer init) { return new PlaceBeacon(init.self, this); } + public object Create(ActorInitializer init) { return new PlaceBeacon(init.Self, this); } } public class PlaceBeacon : IResolveOrder diff --git a/OpenRA.Mods.Common/Traits/Player/PlayerStatistics.cs b/OpenRA.Mods.Common/Traits/Player/PlayerStatistics.cs index e4049c4a2a..f487c60a74 100644 --- a/OpenRA.Mods.Common/Traits/Player/PlayerStatistics.cs +++ b/OpenRA.Mods.Common/Traits/Player/PlayerStatistics.cs @@ -17,7 +17,7 @@ namespace OpenRA.Mods.Common.Traits [Desc("Attach this to the player actor to collect observer stats.")] public class PlayerStatisticsInfo : ITraitInfo { - public object Create(ActorInitializer init) { return new PlayerStatistics(init.self); } + public object Create(ActorInitializer init) { return new PlayerStatistics(init.Self); } } public class PlayerStatistics : ITick, IResolveOrder diff --git a/OpenRA.Mods.Common/Traits/Player/ProvidesCustomPrerequisite.cs b/OpenRA.Mods.Common/Traits/Player/ProvidesCustomPrerequisite.cs index dfff449e47..96a589c3de 100644 --- a/OpenRA.Mods.Common/Traits/Player/ProvidesCustomPrerequisite.cs +++ b/OpenRA.Mods.Common/Traits/Player/ProvidesCustomPrerequisite.cs @@ -41,9 +41,9 @@ namespace OpenRA.Mods.Common.Traits { this.info = info; - var race = init.Contains() ? init.Get() : init.self.Owner.Country.Race; + var race = init.Contains() ? init.Get() : init.Self.Owner.Country.Race; - Update(init.self.Owner, race); + Update(init.Self.Owner, race); } public IEnumerable ProvidesPrerequisites diff --git a/OpenRA.Mods.Common/Traits/Player/ProvidesTechPrerequisite.cs b/OpenRA.Mods.Common/Traits/Player/ProvidesTechPrerequisite.cs index 0a149e1435..4ff2278dcf 100644 --- a/OpenRA.Mods.Common/Traits/Player/ProvidesTechPrerequisite.cs +++ b/OpenRA.Mods.Common/Traits/Player/ProvidesTechPrerequisite.cs @@ -40,7 +40,7 @@ namespace OpenRA.Mods.Common.Traits public ProvidesTechPrerequisite(ProvidesTechPrerequisiteInfo info, ActorInitializer init) { this.info = info; - var tech = init.world.Map.Options.TechLevel ?? init.world.LobbyInfo.GlobalSettings.TechLevel; + var tech = init.World.Map.Options.TechLevel ?? init.World.LobbyInfo.GlobalSettings.TechLevel; this.enabled = info.Name == tech; } } diff --git a/OpenRA.Mods.Common/Traits/Player/StrategicVictoryConditions.cs b/OpenRA.Mods.Common/Traits/Player/StrategicVictoryConditions.cs index b8ffb016b3..98a85d332e 100644 --- a/OpenRA.Mods.Common/Traits/Player/StrategicVictoryConditions.cs +++ b/OpenRA.Mods.Common/Traits/Player/StrategicVictoryConditions.cs @@ -33,7 +33,7 @@ namespace OpenRA.Mods.Common.Traits [Desc("Delay for the end game notification in milliseconds.")] public int NotificationDelay = 1500; - public object Create(ActorInitializer init) { return new StrategicVictoryConditions(init.self, this); } + public object Create(ActorInitializer init) { return new StrategicVictoryConditions(init.Self, this); } } public class StrategicVictoryConditions : ITick, ISync, INotifyObjectivesUpdated diff --git a/OpenRA.Mods.Common/Traits/Player/TechTree.cs b/OpenRA.Mods.Common/Traits/Player/TechTree.cs index 182769aa2e..10945320a0 100644 --- a/OpenRA.Mods.Common/Traits/Player/TechTree.cs +++ b/OpenRA.Mods.Common/Traits/Player/TechTree.cs @@ -28,9 +28,9 @@ namespace OpenRA.Mods.Common.Traits public TechTree(ActorInitializer init) { - player = init.self.Owner; - init.world.ActorAdded += ActorChanged; - init.world.ActorRemoved += ActorChanged; + player = init.Self.Owner; + init.World.ActorAdded += ActorChanged; + init.World.ActorRemoved += ActorChanged; } public void ActorChanged(Actor a) diff --git a/OpenRA.Mods.Common/Traits/Power/AffectedByPowerOutage.cs b/OpenRA.Mods.Common/Traits/Power/AffectedByPowerOutage.cs index 004d79cba4..2488512503 100644 --- a/OpenRA.Mods.Common/Traits/Power/AffectedByPowerOutage.cs +++ b/OpenRA.Mods.Common/Traits/Power/AffectedByPowerOutage.cs @@ -16,7 +16,7 @@ namespace OpenRA.Mods.Common.Traits [Desc("Disables the actor when a power outage is triggered (see `InfiltrateForPowerOutage` for more information).")] public class AffectedByPowerOutageInfo : ITraitInfo { - public object Create(ActorInitializer init) { return new AffectedByPowerOutage(init.self); } + public object Create(ActorInitializer init) { return new AffectedByPowerOutage(init.Self); } } public class AffectedByPowerOutage : INotifyOwnerChanged, ISelectionBar, IPowerModifier, IDisable diff --git a/OpenRA.Mods.Common/Traits/Power/CanPowerDown.cs b/OpenRA.Mods.Common/Traits/Power/CanPowerDown.cs index 07e30a03ac..51db5abf94 100644 --- a/OpenRA.Mods.Common/Traits/Power/CanPowerDown.cs +++ b/OpenRA.Mods.Common/Traits/Power/CanPowerDown.cs @@ -19,7 +19,7 @@ namespace OpenRA.Mods.Common.Traits [Desc("Restore power when this trait is disabled.")] public readonly bool CancelWhenDisabled = false; - public object Create(ActorInitializer init) { return new CanPowerDown(init.self, this); } + public object Create(ActorInitializer init) { return new CanPowerDown(init.Self, this); } } public class CanPowerDown : UpgradableTrait, IPowerModifier, IResolveOrder, IDisable, INotifyOwnerChanged diff --git a/OpenRA.Mods.Common/Traits/Power/Player/PowerManager.cs b/OpenRA.Mods.Common/Traits/Power/Player/PowerManager.cs index 2a3a0cae76..f579eaa8b8 100644 --- a/OpenRA.Mods.Common/Traits/Power/Player/PowerManager.cs +++ b/OpenRA.Mods.Common/Traits/Power/Player/PowerManager.cs @@ -19,7 +19,7 @@ namespace OpenRA.Mods.Common.Traits public readonly int AdviceInterval = 250; public readonly string SpeechNotification = "LowPower"; - public object Create(ActorInitializer init) { return new PowerManager(init.self, this); } + public object Create(ActorInitializer init) { return new PowerManager(init.Self, this); } } public class PowerManager : ITick, ISync diff --git a/OpenRA.Mods.Common/Traits/Power/Power.cs b/OpenRA.Mods.Common/Traits/Power/Power.cs index d4c8d5c2d1..fb7f427a25 100644 --- a/OpenRA.Mods.Common/Traits/Power/Power.cs +++ b/OpenRA.Mods.Common/Traits/Power/Power.cs @@ -19,7 +19,7 @@ namespace OpenRA.Mods.Common.Traits [Desc("If negative, it will drain power. If positive, it will provide power.")] public readonly int Amount = 0; - public object Create(ActorInitializer init) { return new Power(init.self, this); } + public object Create(ActorInitializer init) { return new Power(init.Self, this); } } public class Power : UpgradableTrait, INotifyAddedToWorld, INotifyRemovedFromWorld, INotifyOwnerChanged diff --git a/OpenRA.Mods.Common/Traits/Power/RequiresPower.cs b/OpenRA.Mods.Common/Traits/Power/RequiresPower.cs index a1c680413d..84815d838b 100644 --- a/OpenRA.Mods.Common/Traits/Power/RequiresPower.cs +++ b/OpenRA.Mods.Common/Traits/Power/RequiresPower.cs @@ -15,7 +15,7 @@ namespace OpenRA.Mods.Common.Traits [Desc("Needs power to operate.")] class RequiresPowerInfo : ITraitInfo { - public object Create(ActorInitializer init) { return new RequiresPower(init.self); } + public object Create(ActorInitializer init) { return new RequiresPower(init.Self); } } class RequiresPower : IDisable, INotifyOwnerChanged diff --git a/OpenRA.Mods.Common/Traits/Power/ScalePowerWithHealth.cs b/OpenRA.Mods.Common/Traits/Power/ScalePowerWithHealth.cs index 9d2f68a2c7..e892c9c2cf 100644 --- a/OpenRA.Mods.Common/Traits/Power/ScalePowerWithHealth.cs +++ b/OpenRA.Mods.Common/Traits/Power/ScalePowerWithHealth.cs @@ -15,7 +15,7 @@ namespace OpenRA.Mods.Common.Traits [Desc("Scale power amount with the current health.")] public class ScalePowerWithHealthInfo : ITraitInfo, Requires, Requires { - public object Create(ActorInitializer init) { return new ScalePowerWithHealth(init.self); } + public object Create(ActorInitializer init) { return new ScalePowerWithHealth(init.Self); } } public class ScalePowerWithHealth : IPowerModifier, INotifyDamage, INotifyOwnerChanged diff --git a/OpenRA.Mods.Common/Traits/RadarColorFromTerrain.cs b/OpenRA.Mods.Common/Traits/RadarColorFromTerrain.cs index bc1dc919ed..2c3ccfa630 100644 --- a/OpenRA.Mods.Common/Traits/RadarColorFromTerrain.cs +++ b/OpenRA.Mods.Common/Traits/RadarColorFromTerrain.cs @@ -16,7 +16,7 @@ namespace OpenRA.Mods.Common.Traits public class RadarColorFromTerrainInfo : ITraitInfo { public readonly string Terrain; - public object Create(ActorInitializer init) { return new RadarColorFromTerrain(init.self, Terrain); } + public object Create(ActorInitializer init) { return new RadarColorFromTerrain(init.Self, Terrain); } } public class RadarColorFromTerrain : IRadarColorModifier diff --git a/OpenRA.Mods.Common/Traits/Reloads.cs b/OpenRA.Mods.Common/Traits/Reloads.cs index 93a4edb0c5..db8736f24e 100644 --- a/OpenRA.Mods.Common/Traits/Reloads.cs +++ b/OpenRA.Mods.Common/Traits/Reloads.cs @@ -22,7 +22,7 @@ namespace OpenRA.Mods.Common.Traits [Desc("Whether or not reload counter should be reset when ammo has been fired.")] public readonly bool ResetOnFire = false; - public object Create(ActorInitializer init) { return new Reloads(init.self, this); } + public object Create(ActorInitializer init) { return new Reloads(init.Self, this); } } public class Reloads : ITick diff --git a/OpenRA.Mods.Common/Traits/Render/Hovers.cs b/OpenRA.Mods.Common/Traits/Render/Hovers.cs index c4ffebee27..63e417b367 100644 --- a/OpenRA.Mods.Common/Traits/Render/Hovers.cs +++ b/OpenRA.Mods.Common/Traits/Render/Hovers.cs @@ -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 diff --git a/OpenRA.Mods.Common/Traits/Render/RenderBuilding.cs b/OpenRA.Mods.Common/Traits/Render/RenderBuilding.cs index 1380d7dff5..275b7e6c24 100644 --- a/OpenRA.Mods.Common/Traits/Render/RenderBuilding.cs +++ b/OpenRA.Mods.Common/Traits/Render/RenderBuilding.cs @@ -41,9 +41,9 @@ namespace OpenRA.Mods.Common.Traits : this(init, info, () => 0) { } public RenderBuilding(ActorInitializer init, RenderBuildingInfo info, Func 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")); diff --git a/OpenRA.Mods.Common/Traits/Render/RenderBuildingTurreted.cs b/OpenRA.Mods.Common/Traits/Render/RenderBuildingTurreted.cs index 45e1d626cb..60f5faa5ec 100644 --- a/OpenRA.Mods.Common/Traits/Render/RenderBuildingTurreted.cs +++ b/OpenRA.Mods.Common/Traits/Render/RenderBuildingTurreted.cs @@ -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().FirstOrDefault(); + t = init.Self.TraitsImplementing().FirstOrDefault(); t.QuantizedFacings = DefaultAnimation.CurrentSequence.Facings; } diff --git a/OpenRA.Mods.Common/Traits/Render/RenderEditorOnly.cs b/OpenRA.Mods.Common/Traits/Render/RenderEditorOnly.cs index 2907aa28f2..43e9947275 100644 --- a/OpenRA.Mods.Common/Traits/Render/RenderEditorOnly.cs +++ b/OpenRA.Mods.Common/Traits/Render/RenderEditorOnly.cs @@ -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 diff --git a/OpenRA.Mods.Common/Traits/Render/RenderFlare.cs b/OpenRA.Mods.Common/Traits/Render/RenderFlare.cs index 9c8fa9e7aa..bae8eb7bde 100644 --- a/OpenRA.Mods.Common/Traits/Render/RenderFlare.cs +++ b/OpenRA.Mods.Common/Traits/Render/RenderFlare.cs @@ -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 diff --git a/OpenRA.Mods.Common/Traits/Render/RenderNameTag.cs b/OpenRA.Mods.Common/Traits/Render/RenderNameTag.cs index a8f0c69307..b40c412b08 100644 --- a/OpenRA.Mods.Common/Traits/Render/RenderNameTag.cs +++ b/OpenRA.Mods.Common/Traits/Render/RenderNameTag.cs @@ -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 diff --git a/OpenRA.Mods.Common/Traits/Render/RenderSimple.cs b/OpenRA.Mods.Common/Traits/Render/RenderSimple.cs index 4137de4a24..7422f97619 100644 --- a/OpenRA.Mods.Common/Traits/Render/RenderSimple.cs +++ b/OpenRA.Mods.Common/Traits/Render/RenderSimple.cs @@ -18,7 +18,7 @@ namespace OpenRA.Mods.Common.Traits { public class RenderSimpleInfo : RenderSpritesInfo, IRenderActorPreviewSpritesInfo, IQuantizeBodyOrientationInfo, ILegacyEditorRenderInfo, Requires { - 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 RenderPreviewSprites(ActorPreviewInitializer init, RenderSpritesInfo rs, string image, int facings, PaletteReference p) { diff --git a/OpenRA.Mods.Common/Traits/Render/RenderSprites.cs b/OpenRA.Mods.Common/Traits/Render/RenderSprites.cs index a866a1d23c..92470a2e30 100644 --- a/OpenRA.Mods.Common/Traits/Render/RenderSprites.cs +++ b/OpenRA.Mods.Common/Traits/Render/RenderSprites.cs @@ -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 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(); } } diff --git a/OpenRA.Mods.Common/Traits/Render/RenderUnit.cs b/OpenRA.Mods.Common/Traits/Render/RenderUnit.cs index 9d96988985..17a2f53844 100644 --- a/OpenRA.Mods.Common/Traits/Render/RenderUnit.cs +++ b/OpenRA.Mods.Common/Traits/Render/RenderUnit.cs @@ -15,7 +15,7 @@ namespace OpenRA.Mods.Common.Traits { public class RenderUnitInfo : RenderSimpleInfo, Requires { - 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 diff --git a/OpenRA.Mods.Common/Traits/Render/TimedUpgradeBar.cs b/OpenRA.Mods.Common/Traits/Render/TimedUpgradeBar.cs index 19cacf6d25..b9ca2fd6db 100644 --- a/OpenRA.Mods.Common/Traits/Render/TimedUpgradeBar.cs +++ b/OpenRA.Mods.Common/Traits/Render/TimedUpgradeBar.cs @@ -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 diff --git a/OpenRA.Mods.Common/Traits/Render/WithBarrel.cs b/OpenRA.Mods.Common/Traits/Render/WithBarrel.cs index 94c90e2600..ebfe2a001f 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithBarrel.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithBarrel.cs @@ -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 RenderPreviewSprites(ActorPreviewInitializer init, RenderSpritesInfo rs, string image, int facings, PaletteReference p) { diff --git a/OpenRA.Mods.Common/Traits/Render/WithBuildingPlacedAnimation.cs b/OpenRA.Mods.Common/Traits/Render/WithBuildingPlacedAnimation.cs index bbc0431d13..70cdf9c34e 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithBuildingPlacedAnimation.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithBuildingPlacedAnimation.cs @@ -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 diff --git a/OpenRA.Mods.Common/Traits/Render/WithCrateBody.cs b/OpenRA.Mods.Common/Traits/Render/WithCrateBody.cs index 38e936652e..67fe11523b 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithCrateBody.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithCrateBody.cs @@ -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 diff --git a/OpenRA.Mods.Common/Traits/Render/WithDeathAnimation.cs b/OpenRA.Mods.Common/Traits/Render/WithDeathAnimation.cs index 7483438da9..aebdb9951f 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithDeathAnimation.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithDeathAnimation.cs @@ -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 diff --git a/OpenRA.Mods.Common/Traits/Render/WithHarvestAnimation.cs b/OpenRA.Mods.Common/Traits/Render/WithHarvestAnimation.cs index 9dfce8e173..839d3ea479 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithHarvestAnimation.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithHarvestAnimation.cs @@ -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 diff --git a/OpenRA.Mods.Common/Traits/Render/WithMakeAnimation.cs b/OpenRA.Mods.Common/Traits/Render/WithMakeAnimation.cs index 15c963520e..8c2bda0e18 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithMakeAnimation.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithMakeAnimation.cs @@ -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(); var building = self.Trait(); diff --git a/OpenRA.Mods.Common/Traits/Render/WithMuzzleFlash.cs b/OpenRA.Mods.Common/Traits/Render/WithMuzzleFlash.cs index 15310a8094..538d566d75 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithMuzzleFlash.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithMuzzleFlash.cs @@ -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 diff --git a/OpenRA.Mods.Common/Traits/Render/WithResources.cs b/OpenRA.Mods.Common/Traits/Render/WithResources.cs index 87589ee733..41ae939b51 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithResources.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithResources.cs @@ -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 diff --git a/OpenRA.Mods.Common/Traits/Render/WithRotor.cs b/OpenRA.Mods.Common/Traits/Render/WithRotor.cs index a607a4e279..3317d00f43 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithRotor.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithRotor.cs @@ -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 RenderPreviewSprites(ActorPreviewInitializer init, RenderSpritesInfo rs, string image, int facings, PaletteReference p) { diff --git a/OpenRA.Mods.Common/Traits/Render/WithSmoke.cs b/OpenRA.Mods.Common/Traits/Render/WithSmoke.cs index 56cc848d22..0864bba48a 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithSmoke.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithSmoke.cs @@ -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 diff --git a/OpenRA.Mods.Common/Traits/Render/WithTurret.cs b/OpenRA.Mods.Common/Traits/Render/WithTurret.cs index 409dc1475a..12c61e39f4 100644 --- a/OpenRA.Mods.Common/Traits/Render/WithTurret.cs +++ b/OpenRA.Mods.Common/Traits/Render/WithTurret.cs @@ -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 RenderPreviewSprites(ActorPreviewInitializer init, RenderSpritesInfo rs, string image, int facings, PaletteReference p) { diff --git a/OpenRA.Mods.Common/Traits/SmokeTrailWhenDamaged.cs b/OpenRA.Mods.Common/Traits/SmokeTrailWhenDamaged.cs index b9fac77a96..48391850f2 100644 --- a/OpenRA.Mods.Common/Traits/SmokeTrailWhenDamaged.cs +++ b/OpenRA.Mods.Common/Traits/SmokeTrailWhenDamaged.cs @@ -21,7 +21,7 @@ namespace OpenRA.Mods.Common.Traits public readonly string Sprite = "smokey"; public readonly DamageState MinDamage = DamageState.Heavy; - public object Create(ActorInitializer init) { return new SmokeTrailWhenDamaged(init.self, this); } + public object Create(ActorInitializer init) { return new SmokeTrailWhenDamaged(init.Self, this); } } class SmokeTrailWhenDamaged : ITick diff --git a/OpenRA.Mods.Common/Traits/Sound/AnnounceOnKill.cs b/OpenRA.Mods.Common/Traits/Sound/AnnounceOnKill.cs index 8a7ec178ca..cb17a18f60 100644 --- a/OpenRA.Mods.Common/Traits/Sound/AnnounceOnKill.cs +++ b/OpenRA.Mods.Common/Traits/Sound/AnnounceOnKill.cs @@ -18,7 +18,7 @@ namespace OpenRA.Mods.Common.Traits [Desc("Minimum duration (in seconds) between sound events.")] public readonly int Interval = 5; - public object Create(ActorInitializer init) { return new AnnounceOnKill(init.self, this); } + public object Create(ActorInitializer init) { return new AnnounceOnKill(init.Self, this); } } public class AnnounceOnKill : INotifyAppliedDamage diff --git a/OpenRA.Mods.Common/Traits/Tooltip.cs b/OpenRA.Mods.Common/Traits/Tooltip.cs index b85ee43a7b..00ac450f33 100644 --- a/OpenRA.Mods.Common/Traits/Tooltip.cs +++ b/OpenRA.Mods.Common/Traits/Tooltip.cs @@ -34,7 +34,7 @@ namespace OpenRA.Mods.Common.Traits [Desc("Sequence of the actor that contains the cameo.")] public readonly string Icon = "icon"; - public virtual object Create(ActorInitializer init) { return new Tooltip(init.self, this); } + public virtual object Create(ActorInitializer init) { return new Tooltip(init.Self, this); } public string TooltipForPlayerStance(Stance stance) { diff --git a/OpenRA.Mods.Common/Traits/Upgrades/UpgradeManager.cs b/OpenRA.Mods.Common/Traits/Upgrades/UpgradeManager.cs index 03f08474a9..f24d7561aa 100644 --- a/OpenRA.Mods.Common/Traits/Upgrades/UpgradeManager.cs +++ b/OpenRA.Mods.Common/Traits/Upgrades/UpgradeManager.cs @@ -58,7 +58,7 @@ namespace OpenRA.Mods.Common.Traits upgrades = Exts.Lazy(() => { var ret = new Dictionary(); - foreach (var up in init.self.TraitsImplementing()) + foreach (var up in init.Self.TraitsImplementing()) foreach (var t in up.UpgradeTypes) ret.GetOrAdd(t).Traits.Add(up); diff --git a/OpenRA.Mods.Common/Traits/World/PaletteFromCurrentTileset.cs b/OpenRA.Mods.Common/Traits/World/PaletteFromCurrentTileset.cs index 5a743f23a1..9d41df4366 100644 --- a/OpenRA.Mods.Common/Traits/World/PaletteFromCurrentTileset.cs +++ b/OpenRA.Mods.Common/Traits/World/PaletteFromCurrentTileset.cs @@ -23,7 +23,7 @@ namespace OpenRA.Mods.Common.Traits public readonly int[] ShadowIndex = { }; public readonly bool AllowModifiers = true; - public object Create(ActorInitializer init) { return new PaletteFromCurrentTileset(init.world, this); } + public object Create(ActorInitializer init) { return new PaletteFromCurrentTileset(init.World, this); } } class PaletteFromCurrentTileset : ILoadsPalettes diff --git a/OpenRA.Mods.Common/Traits/World/PaletteFromFile.cs b/OpenRA.Mods.Common/Traits/World/PaletteFromFile.cs index bc6432dfe4..c6eabcb7c4 100644 --- a/OpenRA.Mods.Common/Traits/World/PaletteFromFile.cs +++ b/OpenRA.Mods.Common/Traits/World/PaletteFromFile.cs @@ -26,7 +26,7 @@ namespace OpenRA.Mods.Common.Traits public readonly int[] ShadowIndex = { }; public readonly bool AllowModifiers = true; - public object Create(ActorInitializer init) { return new PaletteFromFile(init.world, this); } + public object Create(ActorInitializer init) { return new PaletteFromFile(init.World, this); } } class PaletteFromFile : ILoadsPalettes diff --git a/OpenRA.Mods.Common/Traits/World/PaletteFromRGBA.cs b/OpenRA.Mods.Common/Traits/World/PaletteFromRGBA.cs index daddb136be..2c96d884a8 100644 --- a/OpenRA.Mods.Common/Traits/World/PaletteFromRGBA.cs +++ b/OpenRA.Mods.Common/Traits/World/PaletteFromRGBA.cs @@ -31,7 +31,7 @@ namespace OpenRA.Mods.Common.Traits public readonly int A = 255; public readonly bool AllowModifiers = true; - public object Create(ActorInitializer init) { return new PaletteFromRGBA(init.world, this); } + public object Create(ActorInitializer init) { return new PaletteFromRGBA(init.World, this); } } class PaletteFromRGBA : ILoadsPalettes diff --git a/OpenRA.Mods.Common/Traits/World/PathFinder.cs b/OpenRA.Mods.Common/Traits/World/PathFinder.cs index 2391e2204d..ad6c447df6 100644 --- a/OpenRA.Mods.Common/Traits/World/PathFinder.cs +++ b/OpenRA.Mods.Common/Traits/World/PathFinder.cs @@ -22,7 +22,7 @@ namespace OpenRA.Mods.Common.Traits [Desc("Calculates routes for mobile units based on the A* search algorithm.", " Attach this to the world actor.")] public class PathFinderInfo : ITraitInfo { - public object Create(ActorInitializer init) { return new PathFinder(init.world); } + public object Create(ActorInitializer init) { return new PathFinder(init.World); } } public class PathFinder diff --git a/OpenRA.Mods.Common/Traits/World/PathfinderDebugOverlay.cs b/OpenRA.Mods.Common/Traits/World/PathfinderDebugOverlay.cs index fd67a716d3..74a749583b 100644 --- a/OpenRA.Mods.Common/Traits/World/PathfinderDebugOverlay.cs +++ b/OpenRA.Mods.Common/Traits/World/PathfinderDebugOverlay.cs @@ -77,7 +77,7 @@ namespace OpenRA.Mods.Common.Traits layer[cell] = layer[cell] * 5 / 6; // TODO: This doesn't make sense for isometric terrain - var pos = wr.world.Map.CenterOfCell(cell); + var pos = wr.World.Map.CenterOfCell(cell); var tl = wr.ScreenPxPosition(pos - new WVec(512, 512, 0)); var br = wr.ScreenPxPosition(pos + new WVec(511, 511, 0)); qr.FillRect(RectangleF.FromLTRB(tl.X, tl.Y, br.X, br.Y), Color.FromArgb(w, c)); diff --git a/OpenRA.Mods.Common/Traits/World/PlayMusicOnMapLoad.cs b/OpenRA.Mods.Common/Traits/World/PlayMusicOnMapLoad.cs index 20f367633c..3423337b7d 100644 --- a/OpenRA.Mods.Common/Traits/World/PlayMusicOnMapLoad.cs +++ b/OpenRA.Mods.Common/Traits/World/PlayMusicOnMapLoad.cs @@ -19,7 +19,7 @@ namespace OpenRA.Mods.Common.Traits public readonly string Music = null; public readonly bool Loop = false; - public object Create(ActorInitializer init) { return new PlayMusicOnMapLoad(init.world, this); } + public object Create(ActorInitializer init) { return new PlayMusicOnMapLoad(init.World, this); } } class PlayMusicOnMapLoad : IWorldLoaded diff --git a/OpenRA.Mods.Common/Traits/World/PlayerPaletteFromCurrentTileset.cs b/OpenRA.Mods.Common/Traits/World/PlayerPaletteFromCurrentTileset.cs index 76691c393b..402e278e09 100644 --- a/OpenRA.Mods.Common/Traits/World/PlayerPaletteFromCurrentTileset.cs +++ b/OpenRA.Mods.Common/Traits/World/PlayerPaletteFromCurrentTileset.cs @@ -23,7 +23,7 @@ namespace OpenRA.Mods.Common.Traits [Desc("Apply palette rotatotors or not.")] public readonly bool AllowModifiers = true; - public object Create(ActorInitializer init) { return new PlayerPaletteFromCurrentTileset(init.world, this); } + public object Create(ActorInitializer init) { return new PlayerPaletteFromCurrentTileset(init.World, this); } } class PlayerPaletteFromCurrentTileset : ILoadsPalettes diff --git a/OpenRA.Mods.Common/Traits/World/ResourceLayer.cs b/OpenRA.Mods.Common/Traits/World/ResourceLayer.cs index 86c97cf6ad..18ee2e2c7c 100644 --- a/OpenRA.Mods.Common/Traits/World/ResourceLayer.cs +++ b/OpenRA.Mods.Common/Traits/World/ResourceLayer.cs @@ -41,7 +41,7 @@ namespace OpenRA.Mods.Common.Traits var c = render[uv.X, uv.Y]; if (c.Sprite != null) - new SpriteRenderable(c.Sprite, wr.world.Map.CenterOfCell(Map.MapToCell(world.Map.TileShape, uv)), + new SpriteRenderable(c.Sprite, wr.World.Map.CenterOfCell(Map.MapToCell(world.Map.TileShape, uv)), WVec.Zero, -511, c.Type.Palette, 1f, true).Render(wr); // TODO ZOffset is ignored } } diff --git a/OpenRA.Mods.Common/Traits/World/ShroudRenderer.cs b/OpenRA.Mods.Common/Traits/World/ShroudRenderer.cs index 41ce83395b..80435b7a2e 100644 --- a/OpenRA.Mods.Common/Traits/World/ShroudRenderer.cs +++ b/OpenRA.Mods.Common/Traits/World/ShroudRenderer.cs @@ -39,7 +39,7 @@ namespace OpenRA.Mods.Common.Traits public readonly int OverrideFogIndex = 15; public readonly BlendMode ShroudBlend = BlendMode.Alpha; - public object Create(ActorInitializer init) { return new ShroudRenderer(init.world, this); } + public object Create(ActorInitializer init) { return new ShroudRenderer(init.World, this); } } public class ShroudRenderer : IRenderShroud, IWorldLoaded @@ -298,13 +298,13 @@ namespace OpenRA.Mods.Common.Traits if (t.Shroud != null) { - var pos = t.ScreenPosition - 0.5f * t.Shroud.size; + var pos = t.ScreenPosition - 0.5f * t.Shroud.Size; Game.Renderer.WorldSpriteRenderer.DrawSprite(t.Shroud, pos, shroudPalette); } if (t.Fog != null) { - var pos = t.ScreenPosition - 0.5f * t.Fog.size; + var pos = t.ScreenPosition - 0.5f * t.Fog.Size; Game.Renderer.WorldSpriteRenderer.DrawSprite(t.Fog, pos, fogPalette); } } diff --git a/OpenRA.Mods.Common/Traits/World/TerrainGeometryOverlay.cs b/OpenRA.Mods.Common/Traits/World/TerrainGeometryOverlay.cs index 893e680cdb..4f454bdc1a 100644 --- a/OpenRA.Mods.Common/Traits/World/TerrainGeometryOverlay.cs +++ b/OpenRA.Mods.Common/Traits/World/TerrainGeometryOverlay.cs @@ -20,7 +20,7 @@ namespace OpenRA.Mods.Common.Traits [Desc("Renders a debug overlay showing the terrain cells. Attach this to the world actor.")] public class TerrainGeometryOverlayInfo : ITraitInfo { - public object Create(ActorInitializer init) { return new TerrainGeometryOverlay(init.self); } + public object Create(ActorInitializer init) { return new TerrainGeometryOverlay(init.Self); } } public class TerrainGeometryOverlay : IRenderOverlay @@ -73,8 +73,8 @@ namespace OpenRA.Mods.Common.Traits if (devMode.Value == null || !devMode.Value.ShowTerrainGeometry) return; - var ts = wr.world.Map.TileShape; - var colors = wr.world.TileSet.HeightDebugColors; + var ts = wr.World.Map.TileShape; + var colors = wr.World.TileSet.HeightDebugColors; var leftDelta = ts == TileShape.Diamond ? new WVec(-512, 0, 0) : new WVec(-512, -512, 0); var topDelta = ts == TileShape.Diamond ? new WVec(0, -512, 0) : new WVec(512, -512, 0); @@ -84,10 +84,10 @@ namespace OpenRA.Mods.Common.Traits foreach (var uv in wr.Viewport.VisibleCells.MapCoords) { var lr = Game.Renderer.WorldLineRenderer; - var pos = wr.world.Map.CenterOfCell(Map.MapToCell(wr.world.Map.TileShape, uv)); + var pos = wr.World.Map.CenterOfCell(Map.MapToCell(wr.World.Map.TileShape, uv)); - var height = (int)wr.world.Map.MapHeight.Value[uv.X, uv.Y]; - var tile = wr.world.Map.MapTiles.Value[uv.X, uv.Y]; + var height = (int)wr.World.Map.MapHeight.Value[uv.X, uv.Y]; + var tile = wr.World.Map.MapTiles.Value[uv.X, uv.Y]; TerrainTileInfo tileInfo = null; @@ -95,7 +95,7 @@ namespace OpenRA.Mods.Common.Traits // (ra/td templates omit Clear tiles from templates) try { - tileInfo = wr.world.TileSet.Templates[tile.Type][tile.Index]; + tileInfo = wr.World.TileSet.Templates[tile.Type][tile.Index]; } catch (Exception) { } diff --git a/OpenRA.Mods.Common/UtilityCommands/CheckYaml.cs b/OpenRA.Mods.Common/UtilityCommands/CheckYaml.cs index 193836984c..dcdd4ae902 100644 --- a/OpenRA.Mods.Common/UtilityCommands/CheckYaml.cs +++ b/OpenRA.Mods.Common/UtilityCommands/CheckYaml.cs @@ -38,7 +38,7 @@ namespace OpenRA.Mods.Common.UtilityCommands public void Run(ModData modData, string[] args) { // HACK: The engine code assumes that Game.modData is set. - Game.modData = modData; + Game.ModData = modData; try { @@ -52,8 +52,8 @@ namespace OpenRA.Mods.Common.UtilityCommands IEnumerable maps; if (args.Length < 2) { - Game.modData.MapCache.LoadMaps(); - maps = Game.modData.MapCache + Game.ModData.MapCache.LoadMaps(); + maps = Game.ModData.MapCache .Where(m => m.Status == MapStatus.Available) .Select(m => m.Map); } @@ -65,12 +65,12 @@ namespace OpenRA.Mods.Common.UtilityCommands Console.WriteLine("Testing map: {0}".F(testMap.Title)); testMap.PreloadRules(); - foreach (var customPassType in Game.modData.ObjectCreator + foreach (var customPassType in Game.ModData.ObjectCreator .GetTypesImplementing()) { try { - var customPass = (ILintPass)Game.modData.ObjectCreator + var customPass = (ILintPass)Game.ModData.ObjectCreator .CreateBasic(customPassType); customPass.Run(EmitError, EmitWarning, testMap); diff --git a/OpenRA.Mods.Common/UtilityCommands/ExtractLanguageStringsCommand.cs b/OpenRA.Mods.Common/UtilityCommands/ExtractLanguageStringsCommand.cs index b3cbd8e361..2b4db88ec6 100644 --- a/OpenRA.Mods.Common/UtilityCommands/ExtractLanguageStringsCommand.cs +++ b/OpenRA.Mods.Common/UtilityCommands/ExtractLanguageStringsCommand.cs @@ -24,14 +24,14 @@ namespace OpenRA.Mods.Common.UtilityCommands public void Run(ModData modData, string[] args) { // HACK: The engine code assumes that Game.modData is set. - Game.modData = modData; - Game.modData.RulesetCache.LoadDefaultRules(); + Game.ModData = modData; + Game.ModData.RulesetCache.LoadDefaultRules(); - var types = Game.modData.ObjectCreator.GetTypes(); + var types = Game.ModData.ObjectCreator.GetTypes(); var translatableFields = types.SelectMany(t => t.GetFields()) .Where(f => f.HasAttribute()).Distinct(); - foreach (var filename in Game.modData.Manifest.ChromeLayout) + foreach (var filename in Game.ModData.Manifest.ChromeLayout) { Console.WriteLine("# {0}:", filename); var yaml = MiniYaml.FromFile(filename); diff --git a/OpenRA.Mods.Common/UtilityCommands/ExtractLuaDocsCommand.cs b/OpenRA.Mods.Common/UtilityCommands/ExtractLuaDocsCommand.cs index 2ff2a346c4..9a18759ede 100644 --- a/OpenRA.Mods.Common/UtilityCommands/ExtractLuaDocsCommand.cs +++ b/OpenRA.Mods.Common/UtilityCommands/ExtractLuaDocsCommand.cs @@ -25,9 +25,9 @@ namespace OpenRA.Mods.Common.UtilityCommands public void Run(ModData modData, string[] args) { // HACK: The engine code assumes that Game.modData is set. - Game.modData = modData; + Game.ModData = modData; - Console.WriteLine("This is an automatically generated listing of the new Lua map scripting API, generated for {0} of OpenRA.", Game.modData.Manifest.Mod.Version); + Console.WriteLine("This is an automatically generated listing of the new Lua map scripting API, generated for {0} of OpenRA.", Game.ModData.Manifest.Mod.Version); Console.WriteLine(); Console.WriteLine("OpenRA allows custom maps and missions to be scripted using Lua 5.1.\n" + "These scripts run in a sandbox that prevents access to unsafe functions (e.g. OS or file access), " + @@ -48,7 +48,7 @@ namespace OpenRA.Mods.Common.UtilityCommands "The properties and commands available on each actor depends on the traits that the actor specifies in its rule definitions.\n"); Console.WriteLine(); - var tables = Game.modData.ObjectCreator.GetTypesImplementing() + var tables = Game.ModData.ObjectCreator.GetTypesImplementing() .OrderBy(t => t.Name); Console.WriteLine("

Global Tables

"); @@ -70,7 +70,7 @@ namespace OpenRA.Mods.Common.UtilityCommands Console.WriteLine("

Actor Properties / Commands

"); - var actorCategories = Game.modData.ObjectCreator.GetTypesImplementing().SelectMany(cg => + var actorCategories = Game.ModData.ObjectCreator.GetTypesImplementing().SelectMany(cg => { var catAttr = cg.GetCustomAttributes(false).FirstOrDefault(); var category = catAttr != null ? catAttr.Category : "Unsorted"; @@ -115,7 +115,7 @@ namespace OpenRA.Mods.Common.UtilityCommands Console.WriteLine("

Player Properties / Commands

"); - var playerCategories = Game.modData.ObjectCreator.GetTypesImplementing().SelectMany(cg => + var playerCategories = Game.ModData.ObjectCreator.GetTypesImplementing().SelectMany(cg => { var catAttr = cg.GetCustomAttributes(false).FirstOrDefault(); var category = catAttr != null ? catAttr.Category : "Unsorted"; diff --git a/OpenRA.Mods.Common/UtilityCommands/ExtractTraitDocsCommand.cs b/OpenRA.Mods.Common/UtilityCommands/ExtractTraitDocsCommand.cs index 0d2feb7967..66d508c072 100644 --- a/OpenRA.Mods.Common/UtilityCommands/ExtractTraitDocsCommand.cs +++ b/OpenRA.Mods.Common/UtilityCommands/ExtractTraitDocsCommand.cs @@ -24,18 +24,18 @@ namespace OpenRA.Mods.Common.UtilityCommands public void Run(ModData modData, string[] args) { // HACK: The engine code assumes that Game.modData is set. - Game.modData = modData; + Game.ModData = modData; Console.WriteLine( "This documentation is aimed at modders. It displays all traits with default values and developer commentary. " + "Please do not edit it directly, but add new `[Desc(\"String\")]` tags to the source code. This file has been " + - "automatically generated for version {0} of OpenRA.", Game.modData.Manifest.Mod.Version); + "automatically generated for version {0} of OpenRA.", Game.ModData.Manifest.Mod.Version); Console.WriteLine(); var toc = new StringBuilder(); var doc = new StringBuilder(); - foreach (var t in Game.modData.ObjectCreator.GetTypesImplementing().OrderBy(t => t.Namespace)) + foreach (var t in Game.ModData.ObjectCreator.GetTypesImplementing().OrderBy(t => t.Namespace)) { if (t.ContainsGenericParameters || t.IsAbstract) continue; // skip helpers like TraitInfo @@ -72,7 +72,7 @@ namespace OpenRA.Mods.Common.UtilityCommands continue; doc.AppendLine(""); doc.AppendLine(""); - var liveTraitInfo = Game.modData.ObjectCreator.CreateBasic(t); + var liveTraitInfo = Game.ModData.ObjectCreator.CreateBasic(t); foreach (var info in infos) { var fieldDescLines = info.Field.GetCustomAttributes(true).SelectMany(d => d.Lines); diff --git a/OpenRA.Mods.Common/UtilityCommands/GenerateMinimapCommand.cs b/OpenRA.Mods.Common/UtilityCommands/GenerateMinimapCommand.cs index 9431c67c23..c948f52a08 100644 --- a/OpenRA.Mods.Common/UtilityCommands/GenerateMinimapCommand.cs +++ b/OpenRA.Mods.Common/UtilityCommands/GenerateMinimapCommand.cs @@ -25,11 +25,11 @@ namespace OpenRA.Mods.Common.UtilityCommands [Desc("MAPFILE", "Render PNG minimap of specified oramap file.")] public void Run(ModData modData, string[] args) { - Game.modData = modData; + Game.ModData = modData; var map = new Map(args[1]); GlobalFileSystem.UnmountAll(); - foreach (var dir in Game.modData.Manifest.Folders) + foreach (var dir in Game.ModData.Manifest.Folders) GlobalFileSystem.Mount(dir); var minimap = Minimap.RenderMapPreview(map.Rules.TileSets[map.Tileset], map, true); diff --git a/OpenRA.Mods.Common/UtilityCommands/GetMapHashCommand.cs b/OpenRA.Mods.Common/UtilityCommands/GetMapHashCommand.cs index 660ac5248d..dd4912b869 100644 --- a/OpenRA.Mods.Common/UtilityCommands/GetMapHashCommand.cs +++ b/OpenRA.Mods.Common/UtilityCommands/GetMapHashCommand.cs @@ -22,7 +22,7 @@ namespace OpenRA.Mods.Common.UtilityCommands [Desc("MAPFILE", "Generate hash of specified oramap file.")] public void Run(ModData modData, string[] args) { - Game.modData = modData; + Game.ModData = modData; var result = new Map(args[1]).Uid; Console.WriteLine(result); } diff --git a/OpenRA.Mods.Common/UtilityCommands/ImportLegacyMapCommand.cs b/OpenRA.Mods.Common/UtilityCommands/ImportLegacyMapCommand.cs index 1cb5cb86fc..aedc437f46 100644 --- a/OpenRA.Mods.Common/UtilityCommands/ImportLegacyMapCommand.cs +++ b/OpenRA.Mods.Common/UtilityCommands/ImportLegacyMapCommand.cs @@ -23,9 +23,9 @@ namespace OpenRA.Mods.Common.UtilityCommands public void Run(ModData modData, string[] args) { // HACK: The engine code assumes that Game.modData is set. - Game.modData = modData; + Game.ModData = modData; - var rules = Game.modData.RulesetCache.LoadDefaultRules(); + var rules = Game.ModData.RulesetCache.LoadDefaultRules(); var map = LegacyMapImporter.Import(args[1], modData.Manifest.Mod.Id, rules, e => Console.WriteLine(e)); var dest = map.Title + ".oramap"; map.Save(dest); diff --git a/OpenRA.Mods.Common/UtilityCommands/RemapShpCommand.cs b/OpenRA.Mods.Common/UtilityCommands/RemapShpCommand.cs index 9644f38fc9..47a6fb4af2 100644 --- a/OpenRA.Mods.Common/UtilityCommands/RemapShpCommand.cs +++ b/OpenRA.Mods.Common/UtilityCommands/RemapShpCommand.cs @@ -37,16 +37,16 @@ namespace OpenRA.Mods.Common.UtilityCommands var srcMod = args[1].Split(':')[0]; - Game.modData = new ModData(srcMod); - GlobalFileSystem.LoadFromManifest(Game.modData.Manifest); - var srcRules = Game.modData.RulesetCache.LoadDefaultRules(); + Game.ModData = new ModData(srcMod); + GlobalFileSystem.LoadFromManifest(Game.ModData.Manifest); + var srcRules = Game.ModData.RulesetCache.LoadDefaultRules(); var srcPaletteInfo = srcRules.Actors["player"].Traits.Get(); var srcRemapIndex = srcPaletteInfo.RemapIndex; var destMod = args[2].Split(':')[0]; - Game.modData = new ModData(destMod); - GlobalFileSystem.LoadFromManifest(Game.modData.Manifest); - var destRules = Game.modData.RulesetCache.LoadDefaultRules(); + Game.ModData = new ModData(destMod); + GlobalFileSystem.LoadFromManifest(Game.ModData.Manifest); + var destRules = Game.ModData.RulesetCache.LoadDefaultRules(); var destPaletteInfo = destRules.Actors["player"].Traits.Get(); var destRemapIndex = destPaletteInfo.RemapIndex; var shadowIndex = new int[] { }; diff --git a/OpenRA.Mods.Common/UtilityCommands/UpgradeMapCommand.cs b/OpenRA.Mods.Common/UtilityCommands/UpgradeMapCommand.cs index d92b789775..ae791040f1 100644 --- a/OpenRA.Mods.Common/UtilityCommands/UpgradeMapCommand.cs +++ b/OpenRA.Mods.Common/UtilityCommands/UpgradeMapCommand.cs @@ -23,7 +23,7 @@ namespace OpenRA.Mods.Common.UtilityCommands public void Run(ModData modData, string[] args) { // HACK: The engine code assumes that Game.modData is set. - Game.modData = modData; + Game.ModData = modData; var map = new Map(args[1]); var engineDate = Exts.ParseIntegerInvariant(args[2]); diff --git a/OpenRA.Mods.Common/UtilityCommands/UpgradeModCommand.cs b/OpenRA.Mods.Common/UtilityCommands/UpgradeModCommand.cs index 8ec5d16d62..bdc94446f3 100644 --- a/OpenRA.Mods.Common/UtilityCommands/UpgradeModCommand.cs +++ b/OpenRA.Mods.Common/UtilityCommands/UpgradeModCommand.cs @@ -24,13 +24,13 @@ namespace OpenRA.Mods.Common.UtilityCommands public void Run(ModData modData, string[] args) { // HACK: The engine code assumes that Game.modData is set. - Game.modData = modData; - Game.modData.MapCache.LoadMaps(); + Game.ModData = modData; + Game.ModData.MapCache.LoadMaps(); var engineDate = Exts.ParseIntegerInvariant(args[1]); Console.WriteLine("Processing Rules:"); - foreach (var filename in Game.modData.Manifest.Rules) + foreach (var filename in Game.ModData.Manifest.Rules) { Console.WriteLine("\t" + filename); var yaml = MiniYaml.FromFile(filename); @@ -41,7 +41,7 @@ namespace OpenRA.Mods.Common.UtilityCommands } Console.WriteLine("Processing Weapons:"); - foreach (var filename in Game.modData.Manifest.Weapons) + foreach (var filename in Game.ModData.Manifest.Weapons) { Console.WriteLine("\t" + filename); var yaml = MiniYaml.FromFile(filename); @@ -52,7 +52,7 @@ namespace OpenRA.Mods.Common.UtilityCommands } Console.WriteLine("Processing Tilesets:"); - foreach (var filename in Game.modData.Manifest.TileSets) + foreach (var filename in Game.ModData.Manifest.TileSets) { Console.WriteLine("\t" + filename); var yaml = MiniYaml.FromFile(filename); @@ -63,7 +63,7 @@ namespace OpenRA.Mods.Common.UtilityCommands } Console.WriteLine("Processing Cursors:"); - foreach (var filename in Game.modData.Manifest.Cursors) + foreach (var filename in Game.ModData.Manifest.Cursors) { Console.WriteLine("\t" + filename); var yaml = MiniYaml.FromFile(filename); @@ -74,7 +74,7 @@ namespace OpenRA.Mods.Common.UtilityCommands } Console.WriteLine("Processing Maps:"); - var maps = Game.modData.MapCache + var maps = Game.ModData.MapCache .Where(m => m.Status == MapStatus.Available) .Select(m => m.Map); diff --git a/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs b/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs index 0d8cd75517..bda37ed9ec 100644 --- a/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs +++ b/OpenRA.Mods.Common/UtilityCommands/UpgradeRules.cs @@ -40,7 +40,7 @@ namespace OpenRA.Mods.Common.UtilityCommands internal static void ConvertPxToRange(ref string input, int scaleMult, int scaleDiv) { var value = Exts.ParseIntegerInvariant(input); - var ts = Game.modData.Manifest.TileSize; + var ts = Game.ModData.Manifest.TileSize; var world = value * 1024 * scaleMult / (scaleDiv * ts.Height); var cells = world / 1024; var subcells = world - 1024 * cells; @@ -57,7 +57,7 @@ namespace OpenRA.Mods.Common.UtilityCommands internal static void ConvertInt2ToWVec(ref string input) { var offset = FieldLoader.GetValue("(value)", input); - var ts = Game.modData.Manifest.TileSize; + var ts = Game.ModData.Manifest.TileSize; var world = new WVec(offset.X * 1024 / ts.Width, offset.Y * 1024 / ts.Height, 0); input = world.ToString(); } diff --git a/OpenRA.Mods.Common/Widgets/ColorMixerWidget.cs b/OpenRA.Mods.Common/Widgets/ColorMixerWidget.cs index 4aa9155676..f6f1db3273 100644 --- a/OpenRA.Mods.Common/Widgets/ColorMixerWidget.cs +++ b/OpenRA.Mods.Common/Widgets/ColorMixerWidget.cs @@ -127,7 +127,7 @@ namespace OpenRA.Mods.Common.Widgets { try { - mixerSprite.sheet.GetTexture().SetData(front, 256, 256); + mixerSprite.Sheet.GetTexture().SetData(front, 256, 256); } finally { @@ -138,8 +138,8 @@ namespace OpenRA.Mods.Common.Widgets Game.Renderer.RgbaSpriteRenderer.DrawSprite(mixerSprite, RenderOrigin, new float2(RenderBounds.Size)); var sprite = ChromeProvider.GetImage("lobby-bits", "colorpicker"); - var pos = RenderOrigin + PxFromValue() - new int2(sprite.bounds.Width, sprite.bounds.Height) / 2; - WidgetUtils.FillEllipseWithColor(new Rectangle(pos.X + 1, pos.Y + 1, sprite.bounds.Width - 2, sprite.bounds.Height - 2), Color.RGB); + var pos = RenderOrigin + PxFromValue() - new int2(sprite.Bounds.Width, sprite.Bounds.Height) / 2; + WidgetUtils.FillEllipseWithColor(new Rectangle(pos.X + 1, pos.Y + 1, sprite.Bounds.Width - 2, sprite.Bounds.Height - 2), Color.RGB); Game.Renderer.RgbaSpriteRenderer.DrawSprite(sprite, pos); } diff --git a/OpenRA.Mods.Common/Widgets/HueSliderWidget.cs b/OpenRA.Mods.Common/Widgets/HueSliderWidget.cs index 6e8aeabde5..e9d8f9c76c 100644 --- a/OpenRA.Mods.Common/Widgets/HueSliderWidget.cs +++ b/OpenRA.Mods.Common/Widgets/HueSliderWidget.cs @@ -55,7 +55,7 @@ namespace OpenRA.Mods.Common.Widgets Game.Renderer.RgbaSpriteRenderer.DrawSprite(hueSprite, ro, new float2(rb.Size)); var sprite = ChromeProvider.GetImage("lobby-bits", "huepicker"); - var pos = RenderOrigin + new int2(PxFromValue(Value).Clamp(0, rb.Width - 1) - sprite.bounds.Width / 2, (rb.Height - sprite.bounds.Height) / 2); + var pos = RenderOrigin + new int2(PxFromValue(Value).Clamp(0, rb.Width - 1) - sprite.Bounds.Width / 2, (rb.Height - sprite.Bounds.Height) / 2); Game.Renderer.RgbaSpriteRenderer.DrawSprite(sprite, pos); } } diff --git a/OpenRA.Mods.Common/Widgets/Logic/ModBrowserLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/ModBrowserLogic.cs index 8b7e110d3d..6fbaf300b2 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/ModBrowserLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/ModBrowserLogic.cs @@ -37,7 +37,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic var panel = widget; var loadButton = panel.Get("LOAD_BUTTON"); loadButton.OnClick = () => LoadMod(selectedMod); - loadButton.IsDisabled = () => selectedMod.Id == Game.modData.Manifest.Mod.Id; + loadButton.IsDisabled = () => selectedMod.Id == Game.ModData.Manifest.Mod.Id; panel.Get("QUIT_BUTTON").OnClick = Game.Exit; diff --git a/OpenRA.Mods.Common/Widgets/Logic/SettingsLogic.cs b/OpenRA.Mods.Common/Widgets/Logic/SettingsLogic.cs index 871861a760..66e639907a 100644 --- a/OpenRA.Mods.Common/Widgets/Logic/SettingsLogic.cs +++ b/OpenRA.Mods.Common/Widgets/Logic/SettingsLogic.cs @@ -212,7 +212,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic colorPreview.Color = ps.Color; var colorDropdown = panel.Get("PLAYERCOLOR"); - colorDropdown.OnMouseDown = _ => ColorPickerLogic.ShowColorDropDown(colorDropdown, colorPreview, worldRenderer.world); + colorDropdown.OnMouseDown = _ => ColorPickerLogic.ShowColorDropDown(colorDropdown, colorPreview, worldRenderer.World); colorDropdown.Get("COLORBLOCK").GetColor = () => ps.Color.RGB; return () => @@ -600,7 +600,7 @@ namespace OpenRA.Mods.Common.Widgets.Logic return item; }; - dropdown.ShowDropDown("LABEL_DROPDOWN_TEMPLATE", 500, Game.modData.Languages, setupItem); + dropdown.ShowDropDown("LABEL_DROPDOWN_TEMPLATE", 500, Game.ModData.Languages, setupItem); return true; } diff --git a/OpenRA.Mods.Common/Widgets/RadarWidget.cs b/OpenRA.Mods.Common/Widgets/RadarWidget.cs index 54c70cc2c8..9c72bb5be9 100644 --- a/OpenRA.Mods.Common/Widgets/RadarWidget.cs +++ b/OpenRA.Mods.Common/Widgets/RadarWidget.cs @@ -94,8 +94,8 @@ namespace OpenRA.Mods.Common.Widgets var uv = Map.CellToMap(world.Map.TileShape, cell); var terrain = world.Map.GetTerrainInfo(cell); - var dx = terrainSprite.bounds.Left - world.Map.Bounds.Left; - var dy = terrainSprite.bounds.Top - world.Map.Bounds.Top; + var dx = terrainSprite.Bounds.Left - world.Map.Bounds.Left; + var dy = terrainSprite.Bounds.Top - world.Map.Bounds.Top; unsafe { @@ -111,8 +111,8 @@ namespace OpenRA.Mods.Common.Widgets { var stride = radarSheet.Size.Width; var uv = Map.CellToMap(world.Map.TileShape, cell); - var dx = shroudSprite.bounds.Left - world.Map.Bounds.Left; - var dy = shroudSprite.bounds.Top - world.Map.Bounds.Top; + var dx = shroudSprite.Bounds.Left - world.Map.Bounds.Left; + var dy = shroudSprite.Bounds.Top - world.Map.Bounds.Top; var color = 0; if (world.ShroudObscures(cell)) @@ -149,7 +149,7 @@ namespace OpenRA.Mods.Common.Widgets if (cursor == null) return "default"; - return Game.modData.CursorProvider.HasCursorSequence(cursor + "-minimap") ? cursor + "-minimap" : cursor; + return Game.ModData.CursorProvider.HasCursorSequence(cursor + "-minimap") ? cursor + "-minimap" : cursor; } public override bool HandleMouseInput(MouseInput mi) @@ -272,10 +272,10 @@ namespace OpenRA.Mods.Common.Widgets // The actor layer is updated every tick var stride = radarSheet.Size.Width; - var dx = actorSprite.bounds.Left - world.Map.Bounds.Left; - var dy = actorSprite.bounds.Top - world.Map.Bounds.Top; + var dx = actorSprite.Bounds.Left - world.Map.Bounds.Left; + var dy = actorSprite.Bounds.Top - world.Map.Bounds.Top; - Array.Clear(radarData, 4 * (actorSprite.bounds.Top * stride + actorSprite.bounds.Left), 4 * actorSprite.bounds.Height * stride); + Array.Clear(radarData, 4 * (actorSprite.Bounds.Top * stride + actorSprite.Bounds.Left), 4 * actorSprite.Bounds.Height * stride); unsafe { diff --git a/OpenRA.Mods.Common/Widgets/ResourceBarWidget.cs b/OpenRA.Mods.Common/Widgets/ResourceBarWidget.cs index 38c326499e..bf4925702c 100644 --- a/OpenRA.Mods.Common/Widgets/ResourceBarWidget.cs +++ b/OpenRA.Mods.Common/Widgets/ResourceBarWidget.cs @@ -99,8 +99,8 @@ namespace OpenRA.Mods.Common.Widgets Game.Renderer.LineRenderer.FillRect(new Rectangle(b.X, (int)float2.Lerp(b.Bottom, b.Top, providedFrac), b.Width, (int)(providedFrac * b.Height)), color); - var x = (b.Left + b.Right - indicator.size.X) / 2; - var y = float2.Lerp(b.Bottom, b.Top, usedFrac) - indicator.size.Y / 2; + var x = (b.Left + b.Right - indicator.Size.X) / 2; + var y = float2.Lerp(b.Bottom, b.Top, usedFrac) - indicator.Size.Y / 2; Game.Renderer.RgbaSpriteRenderer.DrawSprite(indicator, new float2(x, y)); } else @@ -127,8 +127,8 @@ namespace OpenRA.Mods.Common.Widgets else Game.Renderer.LineRenderer.FillRect(new Rectangle(b.X, b.Y, (int)(providedFrac * b.Width), b.Height), color); - var x = float2.Lerp(b.Left, b.Right, usedFrac) - indicator.size.X / 2; - var y = (b.Bottom + b.Top - indicator.size.Y) / 2; + var x = float2.Lerp(b.Left, b.Right, usedFrac) - indicator.Size.X / 2; + var y = (b.Bottom + b.Top - indicator.Size.Y) / 2; Game.Renderer.RgbaSpriteRenderer.DrawSprite(indicator, new float2(x, y)); } } diff --git a/OpenRA.Mods.Common/Widgets/TerrainTemplatePreviewWidget.cs b/OpenRA.Mods.Common/Widgets/TerrainTemplatePreviewWidget.cs index 705c17b143..80435f46c6 100644 --- a/OpenRA.Mods.Common/Widgets/TerrainTemplatePreviewWidget.cs +++ b/OpenRA.Mods.Common/Widgets/TerrainTemplatePreviewWidget.cs @@ -41,8 +41,8 @@ namespace OpenRA.Mods.Common.Widgets if (template == null) return; - var ts = Game.modData.Manifest.TileSize; - var shape = Game.modData.Manifest.TileShape; + var ts = Game.ModData.Manifest.TileSize; + var shape = Game.ModData.Manifest.TileShape; bounds = worldRenderer.Theater.TemplateBounds(template, ts, shape); } } @@ -58,7 +58,7 @@ namespace OpenRA.Mods.Common.Widgets : base(other) { worldRenderer = other.worldRenderer; - tileset = other.worldRenderer.world.Map.Rules.TileSets[other.worldRenderer.world.Map.Tileset]; + tileset = other.worldRenderer.World.Map.Rules.TileSets[other.worldRenderer.World.Map.Tileset]; Template = other.Template; GetScale = other.GetScale; } @@ -70,8 +70,8 @@ namespace OpenRA.Mods.Common.Widgets if (template == null) return; - var ts = Game.modData.Manifest.TileSize; - var shape = Game.modData.Manifest.TileShape; + var ts = Game.ModData.Manifest.TileSize; + var shape = Game.ModData.Manifest.TileShape; var scale = GetScale(); var sb = new Rectangle((int)(scale * bounds.X), (int)(scale * bounds.Y), (int)(scale * bounds.Width), (int)(scale * bounds.Height)); @@ -90,11 +90,11 @@ namespace OpenRA.Mods.Common.Widgets continue; var sprite = worldRenderer.Theater.TileSprite(tile); - var size = new float2(sprite.size.X * scale, sprite.size.Y * scale); + var size = new float2(sprite.Size.X * scale, sprite.Size.Y * scale); var u = shape == TileShape.Rectangle ? x : (x - y) / 2f; var v = shape == TileShape.Rectangle ? y : (x + y) / 2f; - var pos = origin + scale * (new float2(u * ts.Width, (v - 0.5f * tileInfo.Height) * ts.Height) - 0.5f * sprite.size); + var pos = origin + scale * (new float2(u * ts.Width, (v - 0.5f * tileInfo.Height) * ts.Height) - 0.5f * sprite.Size); Game.Renderer.SpriteRenderer.DrawSprite(sprite, pos, worldRenderer.Palette(Palette), size); } } diff --git a/OpenRA.Mods.D2k/Traits/AttackSwallow.cs b/OpenRA.Mods.D2k/Traits/AttackSwallow.cs index d095978a41..8f45207748 100644 --- a/OpenRA.Mods.D2k/Traits/AttackSwallow.cs +++ b/OpenRA.Mods.D2k/Traits/AttackSwallow.cs @@ -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 diff --git a/OpenRA.Mods.D2k/Traits/AutoCarryall.cs b/OpenRA.Mods.D2k/Traits/AutoCarryall.cs index df08f4e34c..618ffe1815 100644 --- a/OpenRA.Mods.D2k/Traits/AutoCarryall.cs +++ b/OpenRA.Mods.D2k/Traits/AutoCarryall.cs @@ -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 { - 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 diff --git a/OpenRA.Mods.D2k/Traits/Buildings/DamagedWithoutFoundation.cs b/OpenRA.Mods.D2k/Traits/Buildings/DamagedWithoutFoundation.cs index 2ed2d3f3fb..e707e7cd8a 100644 --- a/OpenRA.Mods.D2k/Traits/Buildings/DamagedWithoutFoundation.cs +++ b/OpenRA.Mods.D2k/Traits/Buildings/DamagedWithoutFoundation.cs @@ -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 diff --git a/OpenRA.Mods.D2k/Traits/Buildings/LaysTerrain.cs b/OpenRA.Mods.D2k/Traits/Buildings/LaysTerrain.cs index 5ccdc47097..04045f385e 100644 --- a/OpenRA.Mods.D2k/Traits/Buildings/LaysTerrain.cs +++ b/OpenRA.Mods.D2k/Traits/Buildings/LaysTerrain.cs @@ -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 diff --git a/OpenRA.Mods.D2k/Traits/Carryable.cs b/OpenRA.Mods.D2k/Traits/Carryable.cs index 93ba447330..2b2b2dda81 100644 --- a/OpenRA.Mods.D2k/Traits/Carryable.cs +++ b/OpenRA.Mods.D2k/Traits/Carryable.cs @@ -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 diff --git a/OpenRA.Mods.D2k/Traits/Render/WithAttackOverlay.cs b/OpenRA.Mods.D2k/Traits/Render/WithAttackOverlay.cs index 2ff05db787..38bc13aef2 100644 --- a/OpenRA.Mods.D2k/Traits/Render/WithAttackOverlay.cs +++ b/OpenRA.Mods.D2k/Traits/Render/WithAttackOverlay.cs @@ -43,9 +43,9 @@ namespace OpenRA.Mods.D2k.Traits { this.info = info; - renderSprites = init.self.Trait(); + renderSprites = init.Self.Trait(); - 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), diff --git a/OpenRA.Mods.D2k/Traits/Render/WithBuildingPlacedOverlay.cs b/OpenRA.Mods.D2k/Traits/Render/WithBuildingPlacedOverlay.cs index ba7e046e7f..fedca25c7a 100644 --- a/OpenRA.Mods.D2k/Traits/Render/WithBuildingPlacedOverlay.cs +++ b/OpenRA.Mods.D2k/Traits/Render/WithBuildingPlacedOverlay.cs @@ -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 diff --git a/OpenRA.Mods.D2k/Traits/Render/WithCrumbleOverlay.cs b/OpenRA.Mods.D2k/Traits/Render/WithCrumbleOverlay.cs index c66e75ec4f..3683d04ada 100644 --- a/OpenRA.Mods.D2k/Traits/Render/WithCrumbleOverlay.cs +++ b/OpenRA.Mods.D2k/Traits/Render/WithCrumbleOverlay.cs @@ -40,12 +40,12 @@ namespace OpenRA.Mods.D2k.Traits return; var key = "make_overlay_{0}".F(info.Sequence); - var rs = init.self.Trait(); + var rs = init.Self.Trait(); - 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); diff --git a/OpenRA.Mods.D2k/Traits/Render/WithDeliveryOverlay.cs b/OpenRA.Mods.D2k/Traits/Render/WithDeliveryOverlay.cs index c926df0e56..11a6bd05ad 100644 --- a/OpenRA.Mods.D2k/Traits/Render/WithDeliveryOverlay.cs +++ b/OpenRA.Mods.D2k/Traits/Render/WithDeliveryOverlay.cs @@ -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 diff --git a/OpenRA.Mods.D2k/Traits/Render/WithDockingOverlay.cs b/OpenRA.Mods.D2k/Traits/Render/WithDockingOverlay.cs index e7014154ed..7d498cf6cf 100644 --- a/OpenRA.Mods.D2k/Traits/Render/WithDockingOverlay.cs +++ b/OpenRA.Mods.D2k/Traits/Render/WithDockingOverlay.cs @@ -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 diff --git a/OpenRA.Mods.D2k/Traits/Render/WithProductionOverlay.cs b/OpenRA.Mods.D2k/Traits/Render/WithProductionOverlay.cs index a17166d995..972d74df40 100644 --- a/OpenRA.Mods.D2k/Traits/Render/WithProductionOverlay.cs +++ b/OpenRA.Mods.D2k/Traits/Render/WithProductionOverlay.cs @@ -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 diff --git a/OpenRA.Mods.D2k/Traits/TemporaryOwnerManager.cs b/OpenRA.Mods.D2k/Traits/TemporaryOwnerManager.cs index 6447993f64..f0aa36ca16 100644 --- a/OpenRA.Mods.D2k/Traits/TemporaryOwnerManager.cs +++ b/OpenRA.Mods.D2k/Traits/TemporaryOwnerManager.cs @@ -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 diff --git a/OpenRA.Mods.D2k/Traits/World/BuildableTerrainLayer.cs b/OpenRA.Mods.D2k/Traits/World/BuildableTerrainLayer.cs index ae8e909368..ac1c0c69fa 100644 --- a/OpenRA.Mods.D2k/Traits/World/BuildableTerrainLayer.cs +++ b/OpenRA.Mods.D2k/Traits/World/BuildableTerrainLayer.cs @@ -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); } } diff --git a/OpenRA.Mods.D2k/Traits/World/ChooseBuildTabOnSelect.cs b/OpenRA.Mods.D2k/Traits/World/ChooseBuildTabOnSelect.cs index 70f9dc51cc..10899d6aec 100644 --- a/OpenRA.Mods.D2k/Traits/World/ChooseBuildTabOnSelect.cs +++ b/OpenRA.Mods.D2k/Traits/World/ChooseBuildTabOnSelect.cs @@ -33,7 +33,7 @@ namespace OpenRA.Mods.D2k.Traits public ChooseBuildTabOnSelect(ActorInitializer init, ChooseBuildTabOnSelectInfo info) { - world = init.world; + world = init.World; this.info = info; } diff --git a/OpenRA.Mods.D2k/Traits/World/WormManager.cs b/OpenRA.Mods.D2k/Traits/World/WormManager.cs index 0575a03987..92ec0d28c1 100644 --- a/OpenRA.Mods.D2k/Traits/World/WormManager.cs +++ b/OpenRA.Mods.D2k/Traits/World/WormManager.cs @@ -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 diff --git a/OpenRA.Mods.RA/AI/HackyAI.cs b/OpenRA.Mods.RA/AI/HackyAI.cs index d5d96485ab..4043985ba4 100644 --- a/OpenRA.Mods.RA/AI/HackyAI.cs +++ b/OpenRA.Mods.RA/AI/HackyAI.cs @@ -179,7 +179,7 @@ namespace OpenRA.Mods.RA.AI public HackyAI(HackyAIInfo info, ActorInitializer init) { Info = info; - world = init.world; + world = init.World; foreach (var decision in info.PowerDecisions) powerDecisions.Add(decision.OrderName, decision); diff --git a/OpenRA.Mods.RA/Captures.cs b/OpenRA.Mods.RA/Captures.cs index 1b752e2fe5..0b537cec92 100644 --- a/OpenRA.Mods.RA/Captures.cs +++ b/OpenRA.Mods.RA/Captures.cs @@ -27,7 +27,7 @@ namespace OpenRA.Mods.RA.Traits [Desc("Only used if Sabotage=true. Sabotage damage expressed as a percentage of enemy health removed.")] public readonly float SabotageHPRemoval = 0.5f; - public object Create(ActorInitializer init) { return new Captures(init.self, this); } + public object Create(ActorInitializer init) { return new Captures(init.Self, this); } } class Captures : IIssueOrder, IResolveOrder, IOrderVoice diff --git a/OpenRA.Mods.RA/CombatDebugOverlay.cs b/OpenRA.Mods.RA/CombatDebugOverlay.cs index ce3faf2a02..fa9f7e1b52 100644 --- a/OpenRA.Mods.RA/CombatDebugOverlay.cs +++ b/OpenRA.Mods.RA/CombatDebugOverlay.cs @@ -22,7 +22,7 @@ namespace OpenRA.Mods.RA [Desc("Displays fireports, muzzle offsets, and hit areas in developer mode.")] public class CombatDebugOverlayInfo : ITraitInfo { - public object Create(ActorInitializer init) { return new CombatDebugOverlay(init.self); } + public object Create(ActorInitializer init) { return new CombatDebugOverlay(init.Self); } } public class CombatDebugOverlay : IPostRender, INotifyDamage diff --git a/OpenRA.Mods.RA/CrateSpawner.cs b/OpenRA.Mods.RA/CrateSpawner.cs index a539224b33..96a5492f40 100644 --- a/OpenRA.Mods.RA/CrateSpawner.cs +++ b/OpenRA.Mods.RA/CrateSpawner.cs @@ -55,7 +55,7 @@ namespace OpenRA.Mods.RA.Traits [Desc("Spawn and remove the plane this far outside the map.")] public readonly WRange Cordon = new WRange(5120); - public object Create(ActorInitializer init) { return new CrateSpawner(this, init.self); } + public object Create(ActorInitializer init) { return new CrateSpawner(this, init.Self); } } public class CrateSpawner : ITick diff --git a/OpenRA.Mods.RA/Crushable.cs b/OpenRA.Mods.RA/Crushable.cs index 348ffd3800..266fcfe00b 100644 --- a/OpenRA.Mods.RA/Crushable.cs +++ b/OpenRA.Mods.RA/Crushable.cs @@ -26,7 +26,7 @@ namespace OpenRA.Mods.RA.Traits [Desc("Will friendly units just crush me instead of pathing around.")] public readonly bool CrushedByFriendlies = false; - public object Create(ActorInitializer init) { return new Crushable(init.self, this); } + public object Create(ActorInitializer init) { return new Crushable(init.Self, this); } } class Crushable : ICrushable diff --git a/OpenRA.Mods.RA/Disguise.cs b/OpenRA.Mods.RA/Disguise.cs index cd319bf512..b3699451ae 100644 --- a/OpenRA.Mods.RA/Disguise.cs +++ b/OpenRA.Mods.RA/Disguise.cs @@ -20,7 +20,7 @@ namespace OpenRA.Mods.RA.Traits [Desc("Overrides the default ToolTip when this actor is disguised (aids in deceiving enemy players).")] class DisguiseToolTipInfo : TooltipInfo, Requires { - public override object Create(ActorInitializer init) { return new DisguiseToolTip(init.self, this); } + public override object Create(ActorInitializer init) { return new DisguiseToolTip(init.Self, this); } } class DisguiseToolTip : IToolTip diff --git a/OpenRA.Mods.RA/Effects/GpsDot.cs b/OpenRA.Mods.RA/Effects/GpsDot.cs index c31652720b..33bc74e9dc 100644 --- a/OpenRA.Mods.RA/Effects/GpsDot.cs +++ b/OpenRA.Mods.RA/Effects/GpsDot.cs @@ -26,7 +26,7 @@ namespace OpenRA.Mods.RA.Effects public object Create(ActorInitializer init) { - return new GpsDot(init.self, this); + return new GpsDot(init.Self, this); } } diff --git a/OpenRA.Mods.RA/Effects/RepairIndicator.cs b/OpenRA.Mods.RA/Effects/RepairIndicator.cs old mode 100755 new mode 100644 index 48a5d54ecb..57097cefe4 --- a/OpenRA.Mods.RA/Effects/RepairIndicator.cs +++ b/OpenRA.Mods.RA/Effects/RepairIndicator.cs @@ -47,7 +47,7 @@ namespace OpenRA.Mods.RA.Effects public IEnumerable Render(WorldRenderer wr) { - if (building.Destroyed || wr.world.FogObscures(building) || rb.Repairers.Count == 0) + if (building.Destroyed || wr.World.FogObscures(building) || rb.Repairers.Count == 0) return SpriteRenderable.None; var palette = wr.Palette(palettePrefix + rb.Repairers[shownPlayer % rb.Repairers.Count].InternalName); diff --git a/OpenRA.Mods.RA/ExternalCapturable.cs b/OpenRA.Mods.RA/ExternalCapturable.cs index d982684e0f..658f1d9ec2 100644 --- a/OpenRA.Mods.RA/ExternalCapturable.cs +++ b/OpenRA.Mods.RA/ExternalCapturable.cs @@ -47,7 +47,7 @@ namespace OpenRA.Mods.RA.Traits return true; } - public object Create(ActorInitializer init) { return new ExternalCapturable(init.self, this); } + public object Create(ActorInitializer init) { return new ExternalCapturable(init.Self, this); } } public class ExternalCapturable : ITick diff --git a/OpenRA.Mods.RA/ExternalCapturableBar.cs b/OpenRA.Mods.RA/ExternalCapturableBar.cs index ad4b47b4c8..1884196d2b 100644 --- a/OpenRA.Mods.RA/ExternalCapturableBar.cs +++ b/OpenRA.Mods.RA/ExternalCapturableBar.cs @@ -16,7 +16,7 @@ namespace OpenRA.Mods.RA.Traits [Desc("Visualize the remaining CaptureCompleteTime from ExternalCapturable: trait.")] class ExternalCapturableBarInfo : ITraitInfo, Requires { - public object Create(ActorInitializer init) { return new ExternalCapturableBar(init.self); } + public object Create(ActorInitializer init) { return new ExternalCapturableBar(init.Self); } } class ExternalCapturableBar : ISelectionBar diff --git a/OpenRA.Mods.RA/ExternalCaptures.cs b/OpenRA.Mods.RA/ExternalCaptures.cs index 09a3401308..f095578495 100644 --- a/OpenRA.Mods.RA/ExternalCaptures.cs +++ b/OpenRA.Mods.RA/ExternalCaptures.cs @@ -25,7 +25,7 @@ namespace OpenRA.Mods.RA.Traits [Desc("Destroy the unit after capturing.")] public readonly bool ConsumeActor = false; - public object Create(ActorInitializer init) { return new ExternalCaptures(init.self, this); } + public object Create(ActorInitializer init) { return new ExternalCaptures(init.Self, this); } } class ExternalCaptures : IIssueOrder, IResolveOrder, IOrderVoice diff --git a/OpenRA.Mods.RA/Graphics/TeslaZapRenderable.cs b/OpenRA.Mods.RA/Graphics/TeslaZapRenderable.cs index 8ab57800b0..8e8a396e3a 100644 --- a/OpenRA.Mods.RA/Graphics/TeslaZapRenderable.cs +++ b/OpenRA.Mods.RA/Graphics/TeslaZapRenderable.cs @@ -79,8 +79,8 @@ namespace OpenRA.Mods.RA.Graphics public IEnumerable GenerateRenderables(WorldRenderer wr) { - var bright = wr.world.Map.SequenceProvider.GetSequence(image, "bright"); - var dim = wr.world.Map.SequenceProvider.GetSequence(image, "dim"); + var bright = wr.World.Map.SequenceProvider.GetSequence(image, "bright"); + var dim = wr.World.Map.SequenceProvider.GetSequence(image, "dim"); var source = wr.ScreenPosition(pos); var target = wr.ScreenPosition(pos + length); diff --git a/OpenRA.Mods.RA/Lint/CheckMapRules.cs b/OpenRA.Mods.RA/Lint/CheckMapRules.cs index 8f34bb1cf9..fc5d1bf9bc 100644 --- a/OpenRA.Mods.RA/Lint/CheckMapRules.cs +++ b/OpenRA.Mods.RA/Lint/CheckMapRules.cs @@ -19,7 +19,7 @@ namespace OpenRA.Mods.RA { try { - Game.modData.RulesetCache.LoadMapRules(map); + Game.ModData.RulesetCache.LoadMapRules(map); } catch (Exception e) { diff --git a/OpenRA.Mods.RA/Lint/CheckSequences.cs b/OpenRA.Mods.RA/Lint/CheckSequences.cs index 0fa416729c..09418976d1 100644 --- a/OpenRA.Mods.RA/Lint/CheckSequences.cs +++ b/OpenRA.Mods.RA/Lint/CheckSequences.cs @@ -19,7 +19,7 @@ namespace OpenRA.Mods.RA { public void Run(Action emitError, Action emitWarning, Map map) { - var sequences = MiniYaml.MergeLiberal(map.SequenceDefinitions, Game.modData.Manifest.Sequences.Select(s => MiniYaml.FromFile(s)).Aggregate(MiniYaml.MergeLiberal)); + var sequences = MiniYaml.MergeLiberal(map.SequenceDefinitions, Game.ModData.Manifest.Sequences.Select(s => MiniYaml.FromFile(s)).Aggregate(MiniYaml.MergeLiberal)); foreach (var actorInfo in map.Rules.Actors) foreach (var renderInfo in actorInfo.Value.Traits.WithInterface()) diff --git a/OpenRA.Mods.RA/Lint/CheckSyncAnnotations.cs b/OpenRA.Mods.RA/Lint/CheckSyncAnnotations.cs index 50a657574b..0a6b99e900 100644 --- a/OpenRA.Mods.RA/Lint/CheckSyncAnnotations.cs +++ b/OpenRA.Mods.RA/Lint/CheckSyncAnnotations.cs @@ -20,7 +20,7 @@ namespace OpenRA.Mods.RA public void Run(Action emitError, Action emitWarning, Map map) { /* first, check all the types implementing ISync */ - foreach (var t in Game.modData.ObjectCreator.GetTypesImplementing()) + foreach (var t in Game.ModData.ObjectCreator.GetTypesImplementing()) if (!HasAnySyncFields(t)) emitWarning("{0} has ISync but nothing marked with [Sync]".F(t.Name)); } diff --git a/OpenRA.Mods.RA/ParaDrop.cs b/OpenRA.Mods.RA/ParaDrop.cs index ce3fc81e2b..554b95669a 100644 --- a/OpenRA.Mods.RA/ParaDrop.cs +++ b/OpenRA.Mods.RA/ParaDrop.cs @@ -27,7 +27,7 @@ namespace OpenRA.Mods.RA [Desc("Sound to play when dropping.")] public readonly string ChuteSound = "chute1.aud"; - public object Create(ActorInitializer init) { return new ParaDrop(init.self, this); } + public object Create(ActorInitializer init) { return new ParaDrop(init.Self, this); } } public class ParaDrop : ITick, INotifyRemovedFromWorld diff --git a/OpenRA.Mods.RA/Parachutable.cs b/OpenRA.Mods.RA/Parachutable.cs index 945d404c04..79f4169790 100644 --- a/OpenRA.Mods.RA/Parachutable.cs +++ b/OpenRA.Mods.RA/Parachutable.cs @@ -59,7 +59,7 @@ namespace OpenRA.Mods.RA public Parachutable(ActorInitializer init, ParachutableInfo info) { - this.self = init.self; + this.self = init.Self; this.info = info; positionable = self.TraitOrDefault(); diff --git a/OpenRA.Mods.RA/Player/BaseAttackNotifier.cs b/OpenRA.Mods.RA/Player/BaseAttackNotifier.cs index 3890eee8a9..c13bf3049d 100644 --- a/OpenRA.Mods.RA/Player/BaseAttackNotifier.cs +++ b/OpenRA.Mods.RA/Player/BaseAttackNotifier.cs @@ -29,7 +29,7 @@ namespace OpenRA.Mods.RA.Traits [Desc("The audio notification type to play.")] public string Notification = "BaseAttack"; - public object Create(ActorInitializer init) { return new BaseAttackNotifier(init.self, this); } + public object Create(ActorInitializer init) { return new BaseAttackNotifier(init.Self, this); } } public class BaseAttackNotifier : INotifyDamage diff --git a/OpenRA.Mods.RA/Player/ClassicProductionQueue.cs b/OpenRA.Mods.RA/Player/ClassicProductionQueue.cs index 1c8e7a8f9b..d4434f3f22 100644 --- a/OpenRA.Mods.RA/Player/ClassicProductionQueue.cs +++ b/OpenRA.Mods.RA/Player/ClassicProductionQueue.cs @@ -40,9 +40,9 @@ namespace OpenRA.Mods.RA readonly ClassicProductionQueueInfo info; public ClassicProductionQueue(ActorInitializer init, ClassicProductionQueueInfo info) - : base(init, init.self, info) + : base(init, init.Self, info) { - this.self = init.self; + this.self = init.Self; this.info = info; } diff --git a/OpenRA.Mods.RA/Player/HarvesterAttackNotifier.cs b/OpenRA.Mods.RA/Player/HarvesterAttackNotifier.cs index 8bd623cb62..c1958d9a39 100644 --- a/OpenRA.Mods.RA/Player/HarvesterAttackNotifier.cs +++ b/OpenRA.Mods.RA/Player/HarvesterAttackNotifier.cs @@ -29,7 +29,7 @@ namespace OpenRA.Mods.RA.Traits [Desc("The audio notification type to play.")] public string Notification = "HarvesterAttack"; - public object Create(ActorInitializer init) { return new HarvesterAttackNotifier(init.self, this); } + public object Create(ActorInitializer init) { return new HarvesterAttackNotifier(init.Self, this); } } public class HarvesterAttackNotifier : INotifyDamage diff --git a/OpenRA.Mods.RA/Player/ProductionQueue.cs b/OpenRA.Mods.RA/Player/ProductionQueue.cs index a520f31f6d..36703f01f8 100644 --- a/OpenRA.Mods.RA/Player/ProductionQueue.cs +++ b/OpenRA.Mods.RA/Player/ProductionQueue.cs @@ -64,7 +64,7 @@ namespace OpenRA.Mods.RA "The filename of the audio is defined per faction in notifications.yaml.")] public readonly string CancelledAudio = "Cancelled"; - public virtual object Create(ActorInitializer init) { return new ProductionQueue(init, init.self.Owner.PlayerActor, this); } + public virtual object Create(ActorInitializer init) { return new ProductionQueue(init, init.Self.Owner.PlayerActor, this); } } public class ProductionQueue : IResolveOrder, ITick, ITechTreeElement, INotifyOwnerChanged, INotifyKilled, INotifySold, ISync, INotifyTransform @@ -96,7 +96,7 @@ namespace OpenRA.Mods.RA public ProductionQueue(ActorInitializer init, Actor playerActor, ProductionQueueInfo info) { - self = init.self; + self = init.Self; Info = info; playerResources = playerActor.Trait(); playerPower = playerActor.Trait(); diff --git a/OpenRA.Mods.RA/Production.cs b/OpenRA.Mods.RA/Production.cs old mode 100755 new mode 100644 index 363246b7fc..0d421bce55 --- a/OpenRA.Mods.RA/Production.cs +++ b/OpenRA.Mods.RA/Production.cs @@ -26,7 +26,7 @@ namespace OpenRA.Mods.RA.Traits [Desc("e.g. Infantry, Vehicles, Aircraft, Buildings")] public readonly string[] Produces = { }; - public virtual object Create(ActorInitializer init) { return new Production(this, init.self); } + public virtual object Create(ActorInitializer init) { return new Production(this, init.Self); } } public class Production diff --git a/OpenRA.Mods.RA/ProductionBar.cs b/OpenRA.Mods.RA/ProductionBar.cs index d1f7648e88..913a42411e 100644 --- a/OpenRA.Mods.RA/ProductionBar.cs +++ b/OpenRA.Mods.RA/ProductionBar.cs @@ -24,7 +24,7 @@ namespace OpenRA.Mods.RA public readonly Color Color = Color.SkyBlue; - public object Create(ActorInitializer init) { return new ProductionBar(init.self, this); } + public object Create(ActorInitializer init) { return new ProductionBar(init.Self, this); } } class ProductionBar : ISelectionBar, ITick diff --git a/OpenRA.Mods.RA/ProductionQueueFromSelection.cs b/OpenRA.Mods.RA/ProductionQueueFromSelection.cs index 512120514e..f6ab602722 100644 --- a/OpenRA.Mods.RA/ProductionQueueFromSelection.cs +++ b/OpenRA.Mods.RA/ProductionQueueFromSelection.cs @@ -22,7 +22,7 @@ namespace OpenRA.Mods.RA public string ProductionTabsWidget = null; public string ProductionPaletteWidget = null; - public object Create(ActorInitializer init) { return new ProductionQueueFromSelection(init.world, this); } + public object Create(ActorInitializer init) { return new ProductionQueueFromSelection(init.World, this); } } class ProductionQueueFromSelection : INotifySelection diff --git a/OpenRA.Mods.RA/ProximityCapturable.cs b/OpenRA.Mods.RA/ProximityCapturable.cs index b9e0cbc722..9544e98900 100644 --- a/OpenRA.Mods.RA/ProximityCapturable.cs +++ b/OpenRA.Mods.RA/ProximityCapturable.cs @@ -23,7 +23,7 @@ namespace OpenRA.Mods.RA public readonly bool MustBeClear = false; public readonly string[] CaptorTypes = { "Vehicle", "Tank", "Infantry" }; - public object Create(ActorInitializer init) { return new ProximityCapturable(init.self, this); } + public object Create(ActorInitializer init) { return new ProximityCapturable(init.Self, this); } } public class ProximityCapturable : ITick diff --git a/OpenRA.Mods.RA/Render/RenderBuildingSilo.cs b/OpenRA.Mods.RA/Render/RenderBuildingSilo.cs index 10d81b4747..70401dcf58 100644 --- a/OpenRA.Mods.RA/Render/RenderBuildingSilo.cs +++ b/OpenRA.Mods.RA/Render/RenderBuildingSilo.cs @@ -37,7 +37,7 @@ namespace OpenRA.Mods.RA.Traits public RenderBuildingSilo(ActorInitializer init, RenderBuildingSiloInfo info) : base(init, info) { - playerResources = init.self.Owner.PlayerActor.Trait(); + playerResources = init.Self.Owner.PlayerActor.Trait(); } public override void BuildingComplete(Actor self) diff --git a/OpenRA.Mods.RA/Render/RenderBuildingWarFactory.cs b/OpenRA.Mods.RA/Render/RenderBuildingWarFactory.cs old mode 100755 new mode 100644 index ef4bd17086..50d3741123 --- a/OpenRA.Mods.RA/Render/RenderBuildingWarFactory.cs +++ b/OpenRA.Mods.RA/Render/RenderBuildingWarFactory.cs @@ -46,11 +46,11 @@ namespace OpenRA.Mods.RA.Traits public RenderBuildingWarFactory(ActorInitializer init, RenderBuildingInfo info) : base(init, info) { - roof = new Animation(init.world, GetImage(init.self)); - var bi = init.self.Info.Traits.Get(); + roof = new Animation(init.World, GetImage(init.Self)); + var bi = init.Self.Info.Traits.Get(); // Additional 512 units move from center -> top of cell - var offset = FootprintUtils.CenterOffset(init.world, bi).Y + 512; + var offset = FootprintUtils.CenterOffset(init.World, bi).Y + 512; Add("roof", new AnimationWithOffset(roof, null, () => !buildComplete, offset)); } diff --git a/OpenRA.Mods.RA/Render/RenderDisguise.cs b/OpenRA.Mods.RA/Render/RenderDisguise.cs index 96f43b56f3..9d0f32deaf 100644 --- a/OpenRA.Mods.RA/Render/RenderDisguise.cs +++ b/OpenRA.Mods.RA/Render/RenderDisguise.cs @@ -14,7 +14,7 @@ namespace OpenRA.Mods.RA.Traits { class RenderDisguiseInfo : RenderInfantryInfo, Requires { - public override object Create(ActorInitializer init) { return new RenderDisguise(init.self, this); } + public override object Create(ActorInitializer init) { return new RenderDisguise(init.Self, this); } } class RenderDisguise : RenderInfantry diff --git a/OpenRA.Mods.RA/Render/RenderHarvester.cs b/OpenRA.Mods.RA/Render/RenderHarvester.cs index 6e812c6674..680529431c 100644 --- a/OpenRA.Mods.RA/Render/RenderHarvester.cs +++ b/OpenRA.Mods.RA/Render/RenderHarvester.cs @@ -18,7 +18,7 @@ namespace OpenRA.Mods.RA.Traits class RenderHarvesterInfo : RenderUnitInfo, Requires { public readonly string[] ImagesByFullness = { "harv" }; - public override object Create(ActorInitializer init) { return new RenderHarvester(init.self, this); } + public override object Create(ActorInitializer init) { return new RenderHarvester(init.Self, this); } } class RenderHarvester : RenderUnit, INotifyHarvesterAction diff --git a/OpenRA.Mods.RA/Render/RenderInfantry.cs b/OpenRA.Mods.RA/Render/RenderInfantry.cs index cd1989147b..d84402cbca 100644 --- a/OpenRA.Mods.RA/Render/RenderInfantry.cs +++ b/OpenRA.Mods.RA/Render/RenderInfantry.cs @@ -26,7 +26,7 @@ namespace OpenRA.Mods.RA.Traits public readonly string[] IdleAnimations = { }; public readonly string[] StandAnimations = { "stand" }; - public override object Create(ActorInitializer init) { return new RenderInfantry(init.self, this); } + public override object Create(ActorInitializer init) { return new RenderInfantry(init.Self, this); } public override IEnumerable RenderPreviewSprites(ActorPreviewInitializer init, RenderSpritesInfo rs, string image, int facings, PaletteReference p) { diff --git a/OpenRA.Mods.RA/Render/RenderLandingCraft.cs b/OpenRA.Mods.RA/Render/RenderLandingCraft.cs index 21b2f34b38..fd7e057ab7 100644 --- a/OpenRA.Mods.RA/Render/RenderLandingCraft.cs +++ b/OpenRA.Mods.RA/Render/RenderLandingCraft.cs @@ -20,7 +20,7 @@ namespace OpenRA.Mods.RA.Traits public readonly string OpenAnim = "open"; public readonly string UnloadAnim = "unload"; - public override object Create(ActorInitializer init) { return new RenderLandingCraft(init.self, this); } + public override object Create(ActorInitializer init) { return new RenderLandingCraft(init.Self, this); } } public class RenderLandingCraft : RenderUnit diff --git a/OpenRA.Mods.RA/Render/RenderUnitReload.cs b/OpenRA.Mods.RA/Render/RenderUnitReload.cs old mode 100755 new mode 100644 index ac432ba4be..89e08e7bf1 --- a/OpenRA.Mods.RA/Render/RenderUnitReload.cs +++ b/OpenRA.Mods.RA/Render/RenderUnitReload.cs @@ -19,7 +19,7 @@ namespace OpenRA.Mods.RA.Traits [Desc("Armament name")] public readonly string Armament = "primary"; - public override object Create(ActorInitializer init) { return new RenderUnitReload(init.self, this); } + public override object Create(ActorInitializer init) { return new RenderUnitReload(init.Self, this); } } class RenderUnitReload : RenderUnit diff --git a/OpenRA.Mods.RA/Render/WithActiveAnimation.cs b/OpenRA.Mods.RA/Render/WithActiveAnimation.cs index 986bc88075..7cbef7457c 100644 --- a/OpenRA.Mods.RA/Render/WithActiveAnimation.cs +++ b/OpenRA.Mods.RA/Render/WithActiveAnimation.cs @@ -26,7 +26,7 @@ namespace OpenRA.Mods.RA.Traits public readonly bool PauseOnLowPower = false; - public object Create(ActorInitializer init) { return new WithActiveAnimation(init.self, this); } + public object Create(ActorInitializer init) { return new WithActiveAnimation(init.Self, this); } } public class WithActiveAnimation : ITick, INotifyBuildComplete, INotifySold diff --git a/OpenRA.Mods.RA/Render/WithIdleOverlay.cs b/OpenRA.Mods.RA/Render/WithIdleOverlay.cs index 258e390039..323bf3a94c 100644 --- a/OpenRA.Mods.RA/Render/WithIdleOverlay.cs +++ b/OpenRA.Mods.RA/Render/WithIdleOverlay.cs @@ -34,7 +34,7 @@ namespace OpenRA.Mods.RA.Traits public readonly bool PauseOnLowPower = false; - public object Create(ActorInitializer init) { return new WithIdleOverlay(init.self, this); } + public object Create(ActorInitializer init) { return new WithIdleOverlay(init.Self, this); } public IEnumerable RenderPreviewSprites(ActorPreviewInitializer init, RenderSpritesInfo rs, string image, int facings, PaletteReference p) { diff --git a/OpenRA.Mods.RA/Render/WithRepairAnimation.cs b/OpenRA.Mods.RA/Render/WithRepairAnimation.cs index 4598521c92..bed8eedb0d 100644 --- a/OpenRA.Mods.RA/Render/WithRepairAnimation.cs +++ b/OpenRA.Mods.RA/Render/WithRepairAnimation.cs @@ -23,7 +23,7 @@ namespace OpenRA.Mods.RA.Traits public readonly bool PauseOnLowPower = false; - public object Create(ActorInitializer init) { return new WithRepairAnimation(init.self, this); } + public object Create(ActorInitializer init) { return new WithRepairAnimation(init.Self, this); } } public class WithRepairAnimation : INotifyRepair diff --git a/OpenRA.Mods.RA/Render/WithRepairOverlay.cs b/OpenRA.Mods.RA/Render/WithRepairOverlay.cs index c3d62b91bb..10779f73b9 100644 --- a/OpenRA.Mods.RA/Render/WithRepairOverlay.cs +++ b/OpenRA.Mods.RA/Render/WithRepairOverlay.cs @@ -33,7 +33,7 @@ namespace OpenRA.Mods.RA.Traits public readonly bool PauseOnLowPower = false; - public object Create(ActorInitializer init) { return new WithRepairOverlay(init.self, this); } + public object Create(ActorInitializer init) { return new WithRepairOverlay(init.Self, this); } } public class WithRepairOverlay : INotifyDamageStateChanged, INotifyBuildComplete, INotifySold, INotifyRepair diff --git a/OpenRA.Mods.RA/RenderDetectionCircle.cs b/OpenRA.Mods.RA/RenderDetectionCircle.cs index d61bfb9317..78b67e2112 100644 --- a/OpenRA.Mods.RA/RenderDetectionCircle.cs +++ b/OpenRA.Mods.RA/RenderDetectionCircle.cs @@ -19,7 +19,7 @@ namespace OpenRA.Mods.RA.Traits { class RenderDetectionCircleInfo : ITraitInfo { - public object Create(ActorInitializer init) { return new RenderDetectionCircle(init.self); } + public object Create(ActorInitializer init) { return new RenderDetectionCircle(init.Self); } } class RenderDetectionCircle : IPostRenderSelection diff --git a/OpenRA.Mods.RA/RenderJammerCircle.cs b/OpenRA.Mods.RA/RenderJammerCircle.cs index e6c3809279..afe2a77c18 100644 --- a/OpenRA.Mods.RA/RenderJammerCircle.cs +++ b/OpenRA.Mods.RA/RenderJammerCircle.cs @@ -50,7 +50,7 @@ namespace OpenRA.Mods.RA.Traits yield return r; } - public object Create(ActorInitializer init) { return new RenderJammerCircle(init.self); } + public object Create(ActorInitializer init) { return new RenderJammerCircle(init.Self); } } class RenderJammerCircle : IPostRenderSelection diff --git a/OpenRA.Mods.RA/RenderRangeCircle.cs b/OpenRA.Mods.RA/RenderRangeCircle.cs index 5db5e34aff..86a3371549 100644 --- a/OpenRA.Mods.RA/RenderRangeCircle.cs +++ b/OpenRA.Mods.RA/RenderRangeCircle.cs @@ -51,7 +51,7 @@ namespace OpenRA.Mods.RA.Traits yield return r; } - public object Create(ActorInitializer init) { return new RenderRangeCircle(init.self); } + public object Create(ActorInitializer init) { return new RenderRangeCircle(init.Self); } } class RenderRangeCircle : IPostRenderSelection diff --git a/OpenRA.Mods.RA/RenderShroudCircle.cs b/OpenRA.Mods.RA/RenderShroudCircle.cs index 58fb73e371..6029de5391 100644 --- a/OpenRA.Mods.RA/RenderShroudCircle.cs +++ b/OpenRA.Mods.RA/RenderShroudCircle.cs @@ -34,7 +34,7 @@ namespace OpenRA.Mods.RA.Traits yield return r; } - public object Create(ActorInitializer init) { return new RenderShroudCircle(init.self); } + public object Create(ActorInitializer init) { return new RenderShroudCircle(init.Self); } } class RenderShroudCircle : IPostRenderSelection diff --git a/OpenRA.Mods.RA/Repairable.cs b/OpenRA.Mods.RA/Repairable.cs index ea05aa79a2..ada92eb976 100644 --- a/OpenRA.Mods.RA/Repairable.cs +++ b/OpenRA.Mods.RA/Repairable.cs @@ -24,7 +24,7 @@ namespace OpenRA.Mods.RA.Traits class RepairableInfo : ITraitInfo, Requires { public readonly string[] RepairBuildings = { "fix" }; - public virtual object Create(ActorInitializer init) { return new Repairable(init.self); } + public virtual object Create(ActorInitializer init) { return new Repairable(init.Self); } } class Repairable : IIssueOrder, IResolveOrder, IOrderVoice diff --git a/OpenRA.Mods.RA/RepairableNear.cs b/OpenRA.Mods.RA/RepairableNear.cs index 1a33a29708..81640ab455 100644 --- a/OpenRA.Mods.RA/RepairableNear.cs +++ b/OpenRA.Mods.RA/RepairableNear.cs @@ -23,7 +23,7 @@ namespace OpenRA.Mods.RA.Traits [ActorReference] public readonly string[] Buildings = { "spen", "syrd" }; public readonly int CloseEnough = 4; /* cells */ - public object Create(ActorInitializer init) { return new RepairableNear(init.self, this); } + public object Create(ActorInitializer init) { return new RepairableNear(init.Self, this); } } class RepairableNear : IIssueOrder, IResolveOrder diff --git a/OpenRA.Mods.RA/ScaredyCat.cs b/OpenRA.Mods.RA/ScaredyCat.cs index ba4b39f55e..a876514a82 100644 --- a/OpenRA.Mods.RA/ScaredyCat.cs +++ b/OpenRA.Mods.RA/ScaredyCat.cs @@ -25,7 +25,7 @@ namespace OpenRA.Mods.RA.Traits [Desc("Chance (out of 100) the unit has to enter panic mode when attacked.")] public readonly int AttackPanicChance = 20; - public object Create(ActorInitializer init) { return new ScaredyCat(init.self, this); } + public object Create(ActorInitializer init) { return new ScaredyCat(init.Self, this); } } class ScaredyCat : ITick, INotifyIdle, INotifyDamage, INotifyAttack, ISpeedModifier, ISync, IRenderInfantrySequenceModifier diff --git a/OpenRA.Mods.RA/Scripting/Global/ReinforcementsGlobal.cs b/OpenRA.Mods.RA/Scripting/Global/ReinforcementsGlobal.cs index 54a8061478..62376dac6f 100644 --- a/OpenRA.Mods.RA/Scripting/Global/ReinforcementsGlobal.cs +++ b/OpenRA.Mods.RA/Scripting/Global/ReinforcementsGlobal.cs @@ -33,7 +33,7 @@ namespace OpenRA.Mods.RA.Scripting Actor CreateActor(Player owner, string actorType, bool addToWorld, CPos? entryLocation = null, CPos? nextLocation = null) { ActorInfo ai; - if (!context.World.Map.Rules.Actors.TryGetValue(actorType, out ai)) + if (!Context.World.Map.Rules.Actors.TryGetValue(actorType, out ai)) throw new LuaException("Unknown actor type '{0}'".F(actorType)); var initDict = new TypeDictionary(); @@ -48,9 +48,9 @@ namespace OpenRA.Mods.RA.Scripting } if (entryLocation.HasValue && nextLocation.HasValue) - initDict.Add(new FacingInit(context.World.Map.FacingBetween(CPos.Zero, CPos.Zero + (nextLocation.Value - entryLocation.Value), 0))); + initDict.Add(new FacingInit(Context.World.Map.FacingBetween(CPos.Zero, CPos.Zero + (nextLocation.Value - entryLocation.Value), 0))); - var actor = context.World.CreateActor(addToWorld, actorType, initDict); + var actor = Context.World.CreateActor(addToWorld, actorType, initDict); return actor; } @@ -81,7 +81,7 @@ namespace OpenRA.Mods.RA.Scripting var actionDelay = i * interval; Action actorAction = () => { - context.World.Add(actor); + Context.World.Add(actor); for (var j = 1; j < entryPath.Length; j++) Move(actor, entryPath[j]); @@ -89,13 +89,13 @@ namespace OpenRA.Mods.RA.Scripting { actor.QueueActivity(new CallFunc(() => { - af.Call(actor.ToLuaValue(context)); + af.Call(actor.ToLuaValue(Context)); af.Dispose(); })); } }; - context.World.AddFrameEndTask(w => w.Add(new DelayedAction(actionDelay, actorAction))); + Context.World.AddFrameEndTask(w => w.Add(new DelayedAction(actionDelay, actorAction))); } return actors.ToArray(); @@ -134,7 +134,7 @@ namespace OpenRA.Mods.RA.Scripting var af = actionFunc.CopyReference() as LuaFunction; transport.QueueActivity(new CallFunc(() => { - af.Call(transport.ToLuaValue(context), passengers.ToArray().ToLuaValue(context)); + af.Call(transport.ToLuaValue(Context), passengers.ToArray().ToLuaValue(Context)); af.Dispose(); })); } @@ -162,7 +162,7 @@ namespace OpenRA.Mods.RA.Scripting var ef = exitFunc.CopyReference() as LuaFunction; transport.QueueActivity(new CallFunc(() => { - ef.Call(transport.ToLuaValue(context)); + ef.Call(transport.ToLuaValue(Context)); ef.Dispose(); })); } @@ -174,9 +174,9 @@ namespace OpenRA.Mods.RA.Scripting transport.QueueActivity(new RemoveSelf()); } - var ret = context.CreateTable(); - ret.Add(1, transport.ToLuaValue(context)); - ret.Add(2, passengers.ToArray().ToLuaValue(context)); + var ret = Context.CreateTable(); + ret.Add(1, transport.ToLuaValue(Context)); + ret.Add(2, passengers.ToArray().ToLuaValue(Context)); return ret; } } diff --git a/OpenRA.Mods.RA/Scripting/Properties/ChronosphereProperties.cs b/OpenRA.Mods.RA/Scripting/Properties/ChronosphereProperties.cs index cd8ac0831d..2bb4e60467 100644 --- a/OpenRA.Mods.RA/Scripting/Properties/ChronosphereProperties.cs +++ b/OpenRA.Mods.RA/Scripting/Properties/ChronosphereProperties.cs @@ -33,7 +33,7 @@ namespace OpenRA.Mods.RA.Scripting var cs = actor.TraitOrDefault(); if (cs != null && cs.CanChronoshiftTo(actor, cell)) - cs.Teleport(actor, cell, duration, killCargo, self); + cs.Teleport(actor, cell, duration, killCargo, Self); } } } diff --git a/OpenRA.Mods.RA/Scripting/Properties/CombatProperties.cs b/OpenRA.Mods.RA/Scripting/Properties/CombatProperties.cs index 663fa9914b..092911097f 100644 --- a/OpenRA.Mods.RA/Scripting/Properties/CombatProperties.cs +++ b/OpenRA.Mods.RA/Scripting/Properties/CombatProperties.cs @@ -35,7 +35,7 @@ namespace OpenRA.Mods.RA.Scripting [Desc("Seek out and attack nearby targets.")] public void Hunt() { - self.QueueActivity(new Hunt(self)); + Self.QueueActivity(new Hunt(Self)); } [ScriptActorPropertyActivity] @@ -44,7 +44,7 @@ namespace OpenRA.Mods.RA.Scripting "close enough to complete the activity.")] public void AttackMove(CPos cell, int closeEnough = 0) { - self.QueueActivity(new AttackMoveActivity(self, move.MoveTo(cell, closeEnough))); + Self.QueueActivity(new AttackMoveActivity(Self, move.MoveTo(cell, closeEnough))); } [ScriptActorPropertyActivity] @@ -54,12 +54,12 @@ namespace OpenRA.Mods.RA.Scripting { foreach (var wpt in waypoints) { - self.QueueActivity(new AttackMoveActivity(self, move.MoveTo(wpt, 2))); - self.QueueActivity(new Wait(wait)); + Self.QueueActivity(new AttackMoveActivity(Self, move.MoveTo(wpt, 2))); + Self.QueueActivity(new Wait(wait)); } if (loop) - self.QueueActivity(new CallFunc(() => Patrol(waypoints, loop, wait))); + Self.QueueActivity(new CallFunc(() => Patrol(waypoints, loop, wait))); } [ScriptActorPropertyActivity] @@ -69,10 +69,10 @@ namespace OpenRA.Mods.RA.Scripting { Patrol(waypoints, false, wait); - var repeat = func.Call(self.ToLuaValue(context)).First().ToBoolean(); + var repeat = func.Call(Self.ToLuaValue(Context)).First().ToBoolean(); if (repeat) using (var f = func.CopyReference() as LuaFunction) - self.QueueActivity(new CallFunc(() => PatrolUntil(waypoints, f, wait))); + Self.QueueActivity(new CallFunc(() => PatrolUntil(waypoints, f, wait))); } } } diff --git a/OpenRA.Mods.RA/Scripting/Properties/GeneralProperties.cs b/OpenRA.Mods.RA/Scripting/Properties/GeneralProperties.cs index 5ad9b87449..0fa8455ad8 100644 --- a/OpenRA.Mods.RA/Scripting/Properties/GeneralProperties.cs +++ b/OpenRA.Mods.RA/Scripting/Properties/GeneralProperties.cs @@ -32,46 +32,46 @@ namespace OpenRA.Mods.RA.Scripting { get { - return self.IsInWorld; + return Self.IsInWorld; } set { if (value) - self.World.AddFrameEndTask(w => w.Add(self)); + Self.World.AddFrameEndTask(w => w.Add(Self)); else - self.World.AddFrameEndTask(w => w.Remove(self)); + Self.World.AddFrameEndTask(w => w.Remove(Self)); } } [Desc("Specifies whether the actor is alive or dead.")] - public bool IsDead { get { return self.IsDead; } } + public bool IsDead { get { return Self.IsDead; } } [Desc("Specifies whether the actor is idle (not performing any activities).")] - public bool IsIdle { get { return self.IsIdle; } } + public bool IsIdle { get { return Self.IsIdle; } } [Desc("The player that owns the actor.")] public Player Owner { get { - return self.Owner; + return Self.Owner; } set { - if (self.Owner != value) - self.ChangeOwner(value); + if (Self.Owner != value) + Self.ChangeOwner(value); } } [Desc("The type of the actor (e.g. \"e1\").")] - public string Type { get { return self.Info.Name; } } + public string Type { get { return Self.Info.Name; } } [Desc("Test whether an actor has a specific property.")] public bool HasProperty(string name) { - return self.HasScriptProperty(name); + return Self.HasScriptProperty(name); } } @@ -89,10 +89,10 @@ namespace OpenRA.Mods.RA.Scripting } [Desc("The actor position in cell coordinates.")] - public CPos Location { get { return self.Location; } } + public CPos Location { get { return Self.Location; } } [Desc("The actor position in world coordinates.")] - public WPos CenterPosition { get { return self.CenterPosition; } } + public WPos CenterPosition { get { return Self.CenterPosition; } } [Desc("The direction that the actor is facing.")] public int Facing @@ -100,7 +100,7 @@ namespace OpenRA.Mods.RA.Scripting get { if (facing == null) - throw new LuaException("Actor '{0}' doesn't define a facing".F(self)); + throw new LuaException("Actor '{0}' doesn't define a facing".F(Self)); return facing.Facing; } @@ -110,34 +110,34 @@ namespace OpenRA.Mods.RA.Scripting [Desc("Instantly moves the actor to the specified cell.")] public void Teleport(CPos cell) { - self.QueueActivity(new SimpleTeleport(cell)); + Self.QueueActivity(new SimpleTeleport(cell)); } [ScriptActorPropertyActivity] [Desc("Run an arbitrary Lua function.")] public void CallFunc(LuaFunction func) { - self.QueueActivity(new CallLuaFunc(func, context)); + Self.QueueActivity(new CallLuaFunc(func, Context)); } [ScriptActorPropertyActivity] [Desc("Wait for a specified number of game ticks (25 ticks = 1 second).")] public void Wait(int ticks) { - self.QueueActivity(new Wait(ticks)); + Self.QueueActivity(new Wait(ticks)); } [ScriptActorPropertyActivity] [Desc("Remove the actor from the game, without triggering any death notification.")] public void Destroy() { - self.QueueActivity(new RemoveSelf()); + Self.QueueActivity(new RemoveSelf()); } [Desc("Attempt to cancel any active activities.")] public void Stop() { - self.CancelActivity(); + Self.CancelActivity(); } [Desc("Current actor stance. Returns nil if this actor doesn't support stances.")] diff --git a/OpenRA.Mods.RA/Scripting/Properties/GuardProperties.cs b/OpenRA.Mods.RA/Scripting/Properties/GuardProperties.cs index 8d81d61c10..0078f80919 100644 --- a/OpenRA.Mods.RA/Scripting/Properties/GuardProperties.cs +++ b/OpenRA.Mods.RA/Scripting/Properties/GuardProperties.cs @@ -29,7 +29,7 @@ namespace OpenRA.Mods.RA.Scripting public void Guard(Actor targetActor) { if (targetActor.HasTrait()) - guard.GuardTarget(self, Target.FromActor(targetActor)); + guard.GuardTarget(Self, Target.FromActor(targetActor)); } } } \ No newline at end of file diff --git a/OpenRA.Mods.RA/Scripting/Properties/HarvesterProperties.cs b/OpenRA.Mods.RA/Scripting/Properties/HarvesterProperties.cs index 42e51c79cf..80bdd6aae1 100644 --- a/OpenRA.Mods.RA/Scripting/Properties/HarvesterProperties.cs +++ b/OpenRA.Mods.RA/Scripting/Properties/HarvesterProperties.cs @@ -29,7 +29,7 @@ namespace OpenRA.Mods.RA.Scripting [Desc("Search for nearby resources and begin harvesting.")] public void FindResources() { - harvester.ContinueHarvesting(self); + harvester.ContinueHarvesting(Self); } } } \ No newline at end of file diff --git a/OpenRA.Mods.RA/Scripting/Properties/HelicopterProperties.cs b/OpenRA.Mods.RA/Scripting/Properties/HelicopterProperties.cs index c6e18430c1..6f349d1e62 100644 --- a/OpenRA.Mods.RA/Scripting/Properties/HelicopterProperties.cs +++ b/OpenRA.Mods.RA/Scripting/Properties/HelicopterProperties.cs @@ -26,7 +26,7 @@ namespace OpenRA.Mods.RA.Scripting [Desc("Fly within the cell grid.")] public void Move(CPos cell) { - self.QueueActivity(new HeliFly(self, Target.FromCell(self.World, cell))); + Self.QueueActivity(new HeliFly(Self, Target.FromCell(Self.World, cell))); } } } \ No newline at end of file diff --git a/OpenRA.Mods.RA/Scripting/Properties/MissionObjectiveProperties.cs b/OpenRA.Mods.RA/Scripting/Properties/MissionObjectiveProperties.cs index 7df1ee0880..335e629acf 100644 --- a/OpenRA.Mods.RA/Scripting/Properties/MissionObjectiveProperties.cs +++ b/OpenRA.Mods.RA/Scripting/Properties/MissionObjectiveProperties.cs @@ -33,7 +33,7 @@ namespace OpenRA.Mods.RA.Scripting "ID of the newly created objective, so that it can be referred to later.")] public int AddPrimaryObjective(string description) { - return mo.Add(player, description, ObjectiveType.Primary); + return mo.Add(Player, description, ObjectiveType.Primary); } [ScriptActorPropertyActivity] @@ -41,7 +41,7 @@ namespace OpenRA.Mods.RA.Scripting "ID of the newly created objective, so that it can be referred to later.")] public int AddSecondaryObjective(string description) { - return mo.Add(player, description, ObjectiveType.Secondary); + return mo.Add(Player, description, ObjectiveType.Secondary); } [ScriptActorPropertyActivity] @@ -53,7 +53,7 @@ namespace OpenRA.Mods.RA.Scripting if (id < 0 || id >= mo.Objectives.Count) throw new LuaException("Objective ID is out of range."); - mo.MarkCompleted(player, id); + mo.MarkCompleted(Player, id); } [ScriptActorPropertyActivity] @@ -65,7 +65,7 @@ namespace OpenRA.Mods.RA.Scripting if (id < 0 || id >= mo.Objectives.Count) throw new LuaException("Objective ID is out of range."); - mo.MarkFailed(player, id); + mo.MarkFailed(Player, id); } [ScriptActorPropertyActivity] @@ -113,7 +113,7 @@ namespace OpenRA.Mods.RA.Scripting "the MustBeDestroyed trait (according to the short game option).")] public bool HasNoRequiredUnits() { - return player.HasNoRequiredUnits(); + return Player.HasNoRequiredUnits(); } } } diff --git a/OpenRA.Mods.RA/Scripting/Properties/MobileProperties.cs b/OpenRA.Mods.RA/Scripting/Properties/MobileProperties.cs index d3b4f07957..e3335f5e3e 100644 --- a/OpenRA.Mods.RA/Scripting/Properties/MobileProperties.cs +++ b/OpenRA.Mods.RA/Scripting/Properties/MobileProperties.cs @@ -33,28 +33,28 @@ namespace OpenRA.Mods.RA.Scripting "(in cells) that will be considered close enough to complete the activity.")] public void Move(CPos cell, int closeEnough = 0) { - self.QueueActivity(new Move(self, cell, WRange.FromCells(closeEnough))); + Self.QueueActivity(new Move(Self, cell, WRange.FromCells(closeEnough))); } [ScriptActorPropertyActivity] [Desc("Moves within the cell grid, ignoring lane biases.")] public void ScriptedMove(CPos cell) { - self.QueueActivity(new Move(self, cell)); + Self.QueueActivity(new Move(Self, cell)); } [ScriptActorPropertyActivity] [Desc("Moves from outside the world into the cell grid")] public void MoveIntoWorld(CPos cell) { - self.QueueActivity(mobile.MoveIntoWorld(self, cell, mobile.ToSubCell)); + Self.QueueActivity(mobile.MoveIntoWorld(Self, cell, mobile.ToSubCell)); } [ScriptActorPropertyActivity] [Desc("Leave the current position in a random direction.")] public void Scatter() { - self.Trait().Nudge(self, self, true); + Self.Trait().Nudge(Self, Self, true); } } } \ No newline at end of file diff --git a/OpenRA.Mods.RA/Scripting/Properties/PlaneProperties.cs b/OpenRA.Mods.RA/Scripting/Properties/PlaneProperties.cs index 8cd513ad2f..16d6588a88 100644 --- a/OpenRA.Mods.RA/Scripting/Properties/PlaneProperties.cs +++ b/OpenRA.Mods.RA/Scripting/Properties/PlaneProperties.cs @@ -26,14 +26,14 @@ namespace OpenRA.Mods.RA.Scripting [Desc("Fly within the cell grid.")] public void Move(CPos cell) { - self.QueueActivity(new Fly(self, Target.FromCell(self.World, cell))); + Self.QueueActivity(new Fly(Self, Target.FromCell(Self.World, cell))); } [ScriptActorPropertyActivity] [Desc("Return to the base, which is either the airfield given, or an auto-selected one otherwise.")] public void ReturnToBase(Actor airfield = null) { - self.QueueActivity(new ReturnToBase(self, airfield)); + Self.QueueActivity(new ReturnToBase(Self, airfield)); } } @@ -46,7 +46,7 @@ namespace OpenRA.Mods.RA.Scripting [Desc("Fly an attack against the target actor.")] public void Attack(Actor target) { - self.QueueActivity(new FlyAttack(Target.FromActor(target))); + Self.QueueActivity(new FlyAttack(Target.FromActor(target))); } } } \ No newline at end of file diff --git a/OpenRA.Mods.RA/Scripting/Properties/PlayerProperties.cs b/OpenRA.Mods.RA/Scripting/Properties/PlayerProperties.cs index d089bc34ae..316c912faa 100644 --- a/OpenRA.Mods.RA/Scripting/Properties/PlayerProperties.cs +++ b/OpenRA.Mods.RA/Scripting/Properties/PlayerProperties.cs @@ -24,13 +24,13 @@ namespace OpenRA.Mods.RA.Scripting : base(context, player) { } [Desc("The player's name.")] - public string Name { get { return player.PlayerName; } } + public string Name { get { return Player.PlayerName; } } [Desc("Returns an array of actors representing all ground attack units of this player.")] public Actor[] GetGroundAttackers() { - return player.World.ActorsWithTrait().Select(a => a.Actor) - .Where(a => a.Owner == player && !a.IsDead && a.IsInWorld && a.HasTrait()) + return Player.World.ActorsWithTrait().Select(a => a.Actor) + .Where(a => a.Owner == Player && !a.IsDead && a.IsInWorld && a.HasTrait()) .ToArray(); } } diff --git a/OpenRA.Mods.RA/Scripting/Properties/ProductionProperties.cs b/OpenRA.Mods.RA/Scripting/Properties/ProductionProperties.cs index fabd0aca88..c62abdff81 100644 --- a/OpenRA.Mods.RA/Scripting/Properties/ProductionProperties.cs +++ b/OpenRA.Mods.RA/Scripting/Properties/ProductionProperties.cs @@ -37,10 +37,10 @@ namespace OpenRA.Mods.RA.Scripting public void Produce(string actorType, string raceVariant = null) { ActorInfo actorInfo; - if (!self.World.Map.Rules.Actors.TryGetValue(actorType, out actorInfo)) + if (!Self.World.Map.Rules.Actors.TryGetValue(actorType, out actorInfo)) throw new LuaException("Unknown actor type '{0}'".F(actorType)); - self.QueueActivity(new WaitFor(() => p.Produce(self, actorInfo, raceVariant))); + Self.QueueActivity(new WaitFor(() => p.Produce(Self, actorInfo, raceVariant))); } } @@ -78,7 +78,7 @@ namespace OpenRA.Mods.RA.Scripting public bool IsPrimaryBuilding { get { return pb.IsPrimary; } - set { pb.SetPrimaryProducer(self, value); } + set { pb.SetPrimaryProducer(Self, value); } } } @@ -113,7 +113,7 @@ namespace OpenRA.Mods.RA.Scripting if (actionFunc != null) { - var playerIndex = self.Owner.ClientIndex; + var playerIndex = Self.Owner.ClientIndex; var squadSize = actorTypes.Length; var squad = new List(); var func = actionFunc.CopyReference() as LuaFunction; @@ -131,7 +131,7 @@ namespace OpenRA.Mods.RA.Scripting if (squad.Count >= squadSize) { using (func) - using (var luaSquad = squad.Where(u => !u.IsDead).ToArray().ToLuaValue(context)) + using (var luaSquad = squad.Where(u => !u.IsDead).ToArray().ToLuaValue(Context)) func.Call(luaSquad).Dispose(); triggers.OnProducedInternal -= productionHandler; @@ -142,7 +142,7 @@ namespace OpenRA.Mods.RA.Scripting } foreach (var actorType in actorTypes) - queue.ResolveOrder(self, Order.StartProduction(self, actorType, 1)); + queue.ResolveOrder(Self, Order.StartProduction(Self, actorType, 1)); return true; } @@ -160,7 +160,7 @@ namespace OpenRA.Mods.RA.Scripting BuildableInfo GetBuildableInfo(string actorType) { - var ri = self.World.Map.Rules.Actors[actorType]; + var ri = Self.World.Map.Rules.Actors[actorType]; var bi = ri.Traits.GetOrDefault(); if (bi == null) @@ -232,7 +232,7 @@ namespace OpenRA.Mods.RA.Scripting if (squad.Count >= squadSize) { using (func) - using (var luaSquad = squad.Where(u => !u.IsDead).ToArray().ToLuaValue(context)) + using (var luaSquad = squad.Where(u => !u.IsDead).ToArray().ToLuaValue(Context)) func.Call(luaSquad).Dispose(); foreach (var q in queueTypes) @@ -267,7 +267,7 @@ namespace OpenRA.Mods.RA.Scripting BuildableInfo GetBuildableInfo(string actorType) { - var ri = player.World.Map.Rules.Actors[actorType]; + var ri = Player.World.Map.Rules.Actors[actorType]; var bi = ri.Traits.GetOrDefault(); if (bi == null) diff --git a/OpenRA.Mods.RA/Scripting/Properties/RepairableBuildingProperties.cs b/OpenRA.Mods.RA/Scripting/Properties/RepairableBuildingProperties.cs index 6dd5354411..de7d80eb82 100644 --- a/OpenRA.Mods.RA/Scripting/Properties/RepairableBuildingProperties.cs +++ b/OpenRA.Mods.RA/Scripting/Properties/RepairableBuildingProperties.cs @@ -28,19 +28,19 @@ namespace OpenRA.Mods.RA.Scripting [Desc("Start repairs on this building. `repairer` can be an allied player.")] public void StartBuildingRepairs(Player repairer = null) { - repairer = repairer ?? self.Owner; + repairer = repairer ?? Self.Owner; if (!rb.Repairers.Contains(repairer)) - rb.RepairBuilding(self, repairer); + rb.RepairBuilding(Self, repairer); } [Desc("Stop repairs on this building. `repairer` can be an allied player.")] public void StopBuildingRepairs(Player repairer = null) { - repairer = repairer ?? self.Owner; + repairer = repairer ?? Self.Owner; if (rb.RepairActive && rb.Repairers.Contains(repairer)) - rb.RepairBuilding(self, repairer); + rb.RepairBuilding(Self, repairer); } } } diff --git a/OpenRA.Mods.RA/Scripting/Properties/TransportProperties.cs b/OpenRA.Mods.RA/Scripting/Properties/TransportProperties.cs index 3e6c83b107..49e7ad5870 100644 --- a/OpenRA.Mods.RA/Scripting/Properties/TransportProperties.cs +++ b/OpenRA.Mods.RA/Scripting/Properties/TransportProperties.cs @@ -31,16 +31,16 @@ namespace OpenRA.Mods.RA.Scripting public bool HasPassengers { get { return cargo.Passengers.Any(); } } [Desc("Teleport an existing actor inside this transport.")] - public void LoadPassenger(Actor a) { cargo.Load(self, a); } + public void LoadPassenger(Actor a) { cargo.Load(Self, a); } [Desc("Remove the first actor from the transport. This actor is not added to the world.")] - public Actor UnloadPassenger() { return cargo.Unload(self); } + public Actor UnloadPassenger() { return cargo.Unload(Self); } [ScriptActorPropertyActivity] [Desc("Command transport to unload passengers.")] public void UnloadPassengers() { - self.QueueActivity(new UnloadCargo(self, true)); + Self.QueueActivity(new UnloadCargo(Self, true)); } } @@ -60,9 +60,9 @@ namespace OpenRA.Mods.RA.Scripting public void Paradrop(CPos cell) { paradrop.SetLZ(cell, true); - self.QueueActivity(new Fly(self, Target.FromCell(self.World, cell))); - self.QueueActivity(new FlyOffMap()); - self.QueueActivity(new RemoveSelf()); + Self.QueueActivity(new Fly(Self, Target.FromCell(Self.World, cell))); + Self.QueueActivity(new FlyOffMap()); + Self.QueueActivity(new RemoveSelf()); } } } \ No newline at end of file diff --git a/OpenRA.Mods.RA/SelfHealing.cs b/OpenRA.Mods.RA/SelfHealing.cs index 381efc10bf..c7d9a86bc2 100644 --- a/OpenRA.Mods.RA/SelfHealing.cs +++ b/OpenRA.Mods.RA/SelfHealing.cs @@ -23,7 +23,7 @@ namespace OpenRA.Mods.RA public readonly float HealIfBelow = .5f; public readonly int DamageCooldown = 0; - public virtual object Create(ActorInitializer init) { return new SelfHealing(init.self, this); } + public virtual object Create(ActorInitializer init) { return new SelfHealing(init.Self, this); } } class SelfHealing : UpgradableTrait, ITick, INotifyDamage diff --git a/OpenRA.Mods.RA/StoresResources.cs b/OpenRA.Mods.RA/StoresResources.cs index 6052083f5d..91a4908193 100644 --- a/OpenRA.Mods.RA/StoresResources.cs +++ b/OpenRA.Mods.RA/StoresResources.cs @@ -21,7 +21,7 @@ namespace OpenRA.Mods.RA public readonly int PipCount = 0; public readonly PipType PipColor = PipType.Yellow; public readonly int Capacity = 0; - public object Create(ActorInitializer init) { return new StoresResources(init.self, this); } + public object Create(ActorInitializer init) { return new StoresResources(init.Self, this); } } class StoresResources : IPips, INotifyOwnerChanged, INotifyCapture, INotifyKilled, IExplodeModifier, IStoreResources, ISync diff --git a/OpenRA.Mods.RA/SupportPowers/AirstrikePower.cs b/OpenRA.Mods.RA/SupportPowers/AirstrikePower.cs index 600b2df0eb..d1ce8004b0 100644 --- a/OpenRA.Mods.RA/SupportPowers/AirstrikePower.cs +++ b/OpenRA.Mods.RA/SupportPowers/AirstrikePower.cs @@ -40,7 +40,7 @@ namespace OpenRA.Mods.RA.Traits [Desc("Weapon range offset to apply during the beacon clock calculation")] public readonly WRange BeaconDistanceOffset = WRange.FromCells(6); - public override object Create(ActorInitializer init) { return new AirstrikePower(init.self, this); } + public override object Create(ActorInitializer init) { return new AirstrikePower(init.Self, this); } } class AirstrikePower : SupportPower diff --git a/OpenRA.Mods.RA/SupportPowers/GrantUpgradePower.cs b/OpenRA.Mods.RA/SupportPowers/GrantUpgradePower.cs index 220dab0c75..b75c7c97a7 100644 --- a/OpenRA.Mods.RA/SupportPowers/GrantUpgradePower.cs +++ b/OpenRA.Mods.RA/SupportPowers/GrantUpgradePower.cs @@ -29,7 +29,7 @@ namespace OpenRA.Mods.RA.Traits public readonly int Range = 1; public readonly string GrantUpgradeSound = "ironcur9.aud"; - public override object Create(ActorInitializer init) { return new GrantUpgradePower(init.self, this); } + public override object Create(ActorInitializer init) { return new GrantUpgradePower(init.Self, this); } } class GrantUpgradePower : SupportPower @@ -137,7 +137,7 @@ namespace OpenRA.Mods.RA.Traits var pal = wr.Palette("terrain"); foreach (var t in world.Map.FindTilesInCircle(xy, range)) - 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) diff --git a/OpenRA.Mods.RA/SupportPowers/NukePower.cs b/OpenRA.Mods.RA/SupportPowers/NukePower.cs old mode 100755 new mode 100644 index c1c1c21903..0a683fc68e --- a/OpenRA.Mods.RA/SupportPowers/NukePower.cs +++ b/OpenRA.Mods.RA/SupportPowers/NukePower.cs @@ -47,7 +47,7 @@ namespace OpenRA.Mods.RA.Traits [Desc("Amount of time after detonation to remove the camera")] public readonly int CameraRemoveDelay = 25; - public override object Create(ActorInitializer init) { return new NukePower(init.self, this); } + public override object Create(ActorInitializer init) { return new NukePower(init.Self, this); } } class NukePower : SupportPower diff --git a/OpenRA.Mods.RA/SupportPowers/ParatroopersPower.cs b/OpenRA.Mods.RA/SupportPowers/ParatroopersPower.cs index 4ec466df30..cef6957333 100644 --- a/OpenRA.Mods.RA/SupportPowers/ParatroopersPower.cs +++ b/OpenRA.Mods.RA/SupportPowers/ParatroopersPower.cs @@ -50,7 +50,7 @@ namespace OpenRA.Mods.RA.Traits [Desc("Weapon range offset to apply during the beacon clock calculation.")] public readonly WRange BeaconDistanceOffset = WRange.FromCells(4); - public override object Create(ActorInitializer init) { return new ParatroopersPower(init.self, this); } + public override object Create(ActorInitializer init) { return new ParatroopersPower(init.Self, this); } } public class ParatroopersPower : SupportPower diff --git a/OpenRA.Mods.RA/SupportPowers/SpawnActorPower.cs b/OpenRA.Mods.RA/SupportPowers/SpawnActorPower.cs old mode 100755 new mode 100644 index 9a086482fd..b694424b8d --- a/OpenRA.Mods.RA/SupportPowers/SpawnActorPower.cs +++ b/OpenRA.Mods.RA/SupportPowers/SpawnActorPower.cs @@ -30,7 +30,7 @@ namespace OpenRA.Mods.RA.Traits public readonly string EffectSequence = null; public readonly string EffectPalette = null; - public override object Create(ActorInitializer init) { return new SpawnActorPower(init.self, this); } + public override object Create(ActorInitializer init) { return new SpawnActorPower(init.Self, this); } } public class SpawnActorPower : SupportPower diff --git a/OpenRA.Mods.RA/SupportPowers/SupportPowerChargeBar.cs b/OpenRA.Mods.RA/SupportPowers/SupportPowerChargeBar.cs index 1f64bd508e..374a170a0a 100644 --- a/OpenRA.Mods.RA/SupportPowers/SupportPowerChargeBar.cs +++ b/OpenRA.Mods.RA/SupportPowers/SupportPowerChargeBar.cs @@ -19,7 +19,7 @@ namespace OpenRA.Mods.RA.Traits { public readonly Color Color = Color.Magenta; - public object Create(ActorInitializer init) { return new SupportPowerChargeBar(init.self, this); } + public object Create(ActorInitializer init) { return new SupportPowerChargeBar(init.Self, this); } } class SupportPowerChargeBar : ISelectionBar diff --git a/OpenRA.Mods.RA/SupportPowers/SupportPowerManager.cs b/OpenRA.Mods.RA/SupportPowers/SupportPowerManager.cs index 86c279d486..2b13bfdc0c 100644 --- a/OpenRA.Mods.RA/SupportPowers/SupportPowerManager.cs +++ b/OpenRA.Mods.RA/SupportPowers/SupportPowerManager.cs @@ -34,13 +34,13 @@ namespace OpenRA.Mods.RA.Traits public SupportPowerManager(ActorInitializer init) { - self = init.self; + self = init.Self; DevMode = self.Trait(); TechTree = self.Trait(); - RadarPings = Exts.Lazy(() => init.world.WorldActor.TraitOrDefault()); + RadarPings = Exts.Lazy(() => init.World.WorldActor.TraitOrDefault()); - init.world.ActorAdded += ActorAdded; - init.world.ActorRemoved += ActorRemoved; + init.World.ActorAdded += ActorAdded; + init.World.ActorRemoved += ActorRemoved; } static string MakeKey(SupportPower sp) diff --git a/OpenRA.Mods.RA/ThrowsParticle.cs b/OpenRA.Mods.RA/ThrowsParticle.cs index bdfa318508..6cf623cbc9 100644 --- a/OpenRA.Mods.RA/ThrowsParticle.cs +++ b/OpenRA.Mods.RA/ThrowsParticle.cs @@ -57,7 +57,7 @@ namespace OpenRA.Mods.RA.Traits public ThrowsParticle(ActorInitializer init, ThrowsParticleInfo info) { - var self = init.self; + var self = init.Self; var rs = self.Trait(); var body = self.Trait(); @@ -77,7 +77,7 @@ namespace OpenRA.Mods.RA.Traits // Facing rotation rotation = WRange.FromPDF(Game.CosmeticRandom, 2).Range * info.ROT / 1024; - var anim = new Animation(init.world, rs.GetImage(self), () => (int)facing); + var anim = new Animation(init.World, rs.GetImage(self), () => (int)facing); anim.PlayRepeating(info.Anim); rs.Add(info.Anim, new AnimationWithOffset(anim, () => pos, null)); } diff --git a/OpenRA.Mods.RA/Traits/Air/TargetableAircraft.cs b/OpenRA.Mods.RA/Traits/Air/TargetableAircraft.cs index 1d40193bbd..0c0106173a 100644 --- a/OpenRA.Mods.RA/Traits/Air/TargetableAircraft.cs +++ b/OpenRA.Mods.RA/Traits/Air/TargetableAircraft.cs @@ -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 diff --git a/OpenRA.Mods.RA/Traits/Attack/AttackGarrisoned.cs b/OpenRA.Mods.RA/Traits/Attack/AttackGarrisoned.cs index ece4d9d66b..7e2cbd498e 100644 --- a/OpenRA.Mods.RA/Traits/Attack/AttackGarrisoned.cs +++ b/OpenRA.Mods.RA/Traits/Attack/AttackGarrisoned.cs @@ -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 diff --git a/OpenRA.Mods.RA/Traits/Attack/AttackLeap.cs b/OpenRA.Mods.RA/Traits/Attack/AttackLeap.cs index 79072c36f2..8c44e43cec 100644 --- a/OpenRA.Mods.RA/Traits/Attack/AttackLeap.cs +++ b/OpenRA.Mods.RA/Traits/Attack/AttackLeap.cs @@ -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 diff --git a/OpenRA.Mods.RA/Traits/Buildings/Bridge.cs b/OpenRA.Mods.RA/Traits/Buildings/Bridge.cs index 7c378041ca..1c9e04f3ef 100644 --- a/OpenRA.Mods.RA/Traits/Buildings/Bridge.cs +++ b/OpenRA.Mods.RA/Traits/Buildings/Bridge.cs @@ -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> 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; diff --git a/OpenRA.Mods.RA/Traits/Buildings/ClonesProducedUnits.cs b/OpenRA.Mods.RA/Traits/Buildings/ClonesProducedUnits.cs index e39e20de87..ac76896942 100644 --- a/OpenRA.Mods.RA/Traits/Buildings/ClonesProducedUnits.cs +++ b/OpenRA.Mods.RA/Traits/Buildings/ClonesProducedUnits.cs @@ -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 diff --git a/OpenRA.Mods.RA/Traits/Buildings/OreRefinery.cs b/OpenRA.Mods.RA/Traits/Buildings/OreRefinery.cs index c1d8cc6321..80c12775ad 100644 --- a/OpenRA.Mods.RA/Traits/Buildings/OreRefinery.cs +++ b/OpenRA.Mods.RA/Traits/Buildings/OreRefinery.cs @@ -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 diff --git a/OpenRA.Mods.RA/Traits/Buildings/RepairableBuilding.cs b/OpenRA.Mods.RA/Traits/Buildings/RepairableBuilding.cs index 201cae819c..4dca9d083f 100644 --- a/OpenRA.Mods.RA/Traits/Buildings/RepairableBuilding.cs +++ b/OpenRA.Mods.RA/Traits/Buildings/RepairableBuilding.cs @@ -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, ITick diff --git a/OpenRA.Mods.RA/Traits/Buildings/TargetableBuilding.cs b/OpenRA.Mods.RA/Traits/Buildings/TargetableBuilding.cs index 0b236523fa..dee814d7f9 100644 --- a/OpenRA.Mods.RA/Traits/Buildings/TargetableBuilding.cs +++ b/OpenRA.Mods.RA/Traits/Buildings/TargetableBuilding.cs @@ -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 diff --git a/OpenRA.Mods.RA/Traits/Crates/Crate.cs b/OpenRA.Mods.RA/Traits/Crates/Crate.cs index 9c5aac236f..64169db8d8 100644 --- a/OpenRA.Mods.RA/Traits/Crates/Crate.cs +++ b/OpenRA.Mods.RA/Traits/Crates/Crate.cs @@ -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()) diff --git a/OpenRA.Mods.RA/Traits/Crates/CrateAction.cs b/OpenRA.Mods.RA/Traits/Crates/CrateAction.cs index 23490f0262..1cc233d171 100644 --- a/OpenRA.Mods.RA/Traits/Crates/CrateAction.cs +++ b/OpenRA.Mods.RA/Traits/Crates/CrateAction.cs @@ -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 diff --git a/OpenRA.Mods.RA/Traits/Crates/DuplicateUnitCrateAction.cs b/OpenRA.Mods.RA/Traits/Crates/DuplicateUnitCrateAction.cs index 308604cf31..41a366c776 100644 --- a/OpenRA.Mods.RA/Traits/Crates/DuplicateUnitCrateAction.cs +++ b/OpenRA.Mods.RA/Traits/Crates/DuplicateUnitCrateAction.cs @@ -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 diff --git a/OpenRA.Mods.RA/Traits/Crates/ExplodeCrateAction.cs b/OpenRA.Mods.RA/Traits/Crates/ExplodeCrateAction.cs index 374b01a596..21b48354b7 100644 --- a/OpenRA.Mods.RA/Traits/Crates/ExplodeCrateAction.cs +++ b/OpenRA.Mods.RA/Traits/Crates/ExplodeCrateAction.cs @@ -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 diff --git a/OpenRA.Mods.RA/Traits/Crates/GiveCashCrateAction.cs b/OpenRA.Mods.RA/Traits/Crates/GiveCashCrateAction.cs index 88612612e6..30462d5bec 100644 --- a/OpenRA.Mods.RA/Traits/Crates/GiveCashCrateAction.cs +++ b/OpenRA.Mods.RA/Traits/Crates/GiveCashCrateAction.cs @@ -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 diff --git a/OpenRA.Mods.RA/Traits/Crates/GiveMcvCrateAction.cs b/OpenRA.Mods.RA/Traits/Crates/GiveMcvCrateAction.cs index c38e0aca89..8bf5103133 100644 --- a/OpenRA.Mods.RA/Traits/Crates/GiveMcvCrateAction.cs +++ b/OpenRA.Mods.RA/Traits/Crates/GiveMcvCrateAction.cs @@ -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 diff --git a/OpenRA.Mods.RA/Traits/Crates/GiveUnitCrateAction.cs b/OpenRA.Mods.RA/Traits/Crates/GiveUnitCrateAction.cs index cce7d9ab5b..7d45e266e3 100644 --- a/OpenRA.Mods.RA/Traits/Crates/GiveUnitCrateAction.cs +++ b/OpenRA.Mods.RA/Traits/Crates/GiveUnitCrateAction.cs @@ -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 diff --git a/OpenRA.Mods.RA/Traits/Crates/GrantUpgradeCrateAction.cs b/OpenRA.Mods.RA/Traits/Crates/GrantUpgradeCrateAction.cs index 4cee91daac..7d91bbd934 100644 --- a/OpenRA.Mods.RA/Traits/Crates/GrantUpgradeCrateAction.cs +++ b/OpenRA.Mods.RA/Traits/Crates/GrantUpgradeCrateAction.cs @@ -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 diff --git a/OpenRA.Mods.RA/Traits/Crates/HealUnitsCrateAction.cs b/OpenRA.Mods.RA/Traits/Crates/HealUnitsCrateAction.cs index f0205fb371..fd68dd21b6 100644 --- a/OpenRA.Mods.RA/Traits/Crates/HealUnitsCrateAction.cs +++ b/OpenRA.Mods.RA/Traits/Crates/HealUnitsCrateAction.cs @@ -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 diff --git a/OpenRA.Mods.RA/Traits/Crates/HideMapCrateAction.cs b/OpenRA.Mods.RA/Traits/Crates/HideMapCrateAction.cs index f6b559de1f..bf0af7554e 100644 --- a/OpenRA.Mods.RA/Traits/Crates/HideMapCrateAction.cs +++ b/OpenRA.Mods.RA/Traits/Crates/HideMapCrateAction.cs @@ -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 diff --git a/OpenRA.Mods.RA/Traits/Crates/LevelUpCrateAction.cs b/OpenRA.Mods.RA/Traits/Crates/LevelUpCrateAction.cs index b9f26edf37..7f7c4d6c97 100644 --- a/OpenRA.Mods.RA/Traits/Crates/LevelUpCrateAction.cs +++ b/OpenRA.Mods.RA/Traits/Crates/LevelUpCrateAction.cs @@ -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 diff --git a/OpenRA.Mods.RA/Traits/Crates/RevealMapCrateAction.cs b/OpenRA.Mods.RA/Traits/Crates/RevealMapCrateAction.cs index c02fd6ad6c..5eead441dc 100644 --- a/OpenRA.Mods.RA/Traits/Crates/RevealMapCrateAction.cs +++ b/OpenRA.Mods.RA/Traits/Crates/RevealMapCrateAction.cs @@ -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 diff --git a/OpenRA.Mods.RA/Traits/Crates/SupportPowerCrateAction.cs b/OpenRA.Mods.RA/Traits/Crates/SupportPowerCrateAction.cs index d64307a1cd..9dc4deb334 100644 --- a/OpenRA.Mods.RA/Traits/Crates/SupportPowerCrateAction.cs +++ b/OpenRA.Mods.RA/Traits/Crates/SupportPowerCrateAction.cs @@ -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 diff --git a/OpenRA.Mods.RA/Traits/Harvester.cs b/OpenRA.Mods.RA/Traits/Harvester.cs index fd4d2514bd..02cccc6900 100644 --- a/OpenRA.Mods.RA/Traits/Harvester.cs +++ b/OpenRA.Mods.RA/Traits/Harvester.cs @@ -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, diff --git a/OpenRA.Mods.RA/Traits/Infiltration/InfiltrateForPowerOutage.cs b/OpenRA.Mods.RA/Traits/Infiltration/InfiltrateForPowerOutage.cs index f46541c654..4ac16c0cb5 100644 --- a/OpenRA.Mods.RA/Traits/Infiltration/InfiltrateForPowerOutage.cs +++ b/OpenRA.Mods.RA/Traits/Infiltration/InfiltrateForPowerOutage.cs @@ -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 diff --git a/OpenRA.Mods.RA/Traits/LeavesHusk.cs b/OpenRA.Mods.RA/Traits/LeavesHusk.cs index 9948e2e351..2ac329a1ca 100644 --- a/OpenRA.Mods.RA/Traits/LeavesHusk.cs +++ b/OpenRA.Mods.RA/Traits/LeavesHusk.cs @@ -33,7 +33,7 @@ namespace OpenRA.Mods.RA.Traits { this.info = info; - race = init.Contains() ? init.Get() : init.self.Owner.Country.Race; + race = init.Contains() ? init.Get() : init.Self.Owner.Country.Race; } public void Killed(Actor self, AttackInfo e) diff --git a/OpenRA.Mods.RA/Traits/MadTank.cs b/OpenRA.Mods.RA/Traits/MadTank.cs index 9c582de44c..76035f7804 100644 --- a/OpenRA.Mods.RA/Traits/MadTank.cs +++ b/OpenRA.Mods.RA/Traits/MadTank.cs @@ -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 diff --git a/OpenRA.Mods.RA/Traits/Mine.cs b/OpenRA.Mods.RA/Traits/Mine.cs index d37545222a..9915a52dbc 100644 --- a/OpenRA.Mods.RA/Traits/Mine.cs +++ b/OpenRA.Mods.RA/Traits/Mine.cs @@ -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; } diff --git a/OpenRA.Mods.RA/Traits/Minelayer.cs b/OpenRA.Mods.RA/Traits/Minelayer.cs index 5a81415c80..af6282d24d 100644 --- a/OpenRA.Mods.RA/Traits/Minelayer.cs +++ b/OpenRA.Mods.RA/Traits/Minelayer.cs @@ -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 diff --git a/OpenRA.Mods.RA/Traits/SeedsResource.cs b/OpenRA.Mods.RA/Traits/SeedsResource.cs index 4edf5b79bc..2aa7cf4cd9 100644 --- a/OpenRA.Mods.RA/Traits/SeedsResource.cs +++ b/OpenRA.Mods.RA/Traits/SeedsResource.cs @@ -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 diff --git a/OpenRA.Mods.RA/Traits/SupportPowers/ChronoshiftPower.cs b/OpenRA.Mods.RA/Traits/SupportPowers/ChronoshiftPower.cs index ca64de2bed..e68c44a816 100644 --- a/OpenRA.Mods.RA/Traits/SupportPowers/ChronoshiftPower.cs +++ b/OpenRA.Mods.RA/Traits/SupportPowers/ChronoshiftPower.cs @@ -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().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); } } } diff --git a/OpenRA.Mods.RA/Traits/SupportPowers/GpsPower.cs b/OpenRA.Mods.RA/Traits/SupportPowers/GpsPower.cs index 9a20bc1cbd..29c841f68b 100644 --- a/OpenRA.Mods.RA/Traits/SupportPowers/GpsPower.cs +++ b/OpenRA.Mods.RA/Traits/SupportPowers/GpsPower.cs @@ -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 diff --git a/OpenRA.Mods.RA/Traits/TargetableSubmarine.cs b/OpenRA.Mods.RA/Traits/TargetableSubmarine.cs index b1bbfd9250..2ad7fe589d 100644 --- a/OpenRA.Mods.RA/Traits/TargetableSubmarine.cs +++ b/OpenRA.Mods.RA/Traits/TargetableSubmarine.cs @@ -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 diff --git a/OpenRA.Mods.RA/Traits/TargetableUnit.cs b/OpenRA.Mods.RA/Traits/TargetableUnit.cs index 4c42f28201..3a15013599 100644 --- a/OpenRA.Mods.RA/Traits/TargetableUnit.cs +++ b/OpenRA.Mods.RA/Traits/TargetableUnit.cs @@ -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 diff --git a/OpenRA.Mods.RA/Traits/World/BridgeLayer.cs b/OpenRA.Mods.RA/Traits/World/BridgeLayer.cs index 15cdb8140f..fa8c094d0b 100644 --- a/OpenRA.Mods.RA/Traits/World/BridgeLayer.cs +++ b/OpenRA.Mods.RA/Traits/World/BridgeLayer.cs @@ -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 diff --git a/OpenRA.Mods.RA/Transforms.cs b/OpenRA.Mods.RA/Transforms.cs index 53fe8eca5a..fe59311234 100644 --- a/OpenRA.Mods.RA/Transforms.cs +++ b/OpenRA.Mods.RA/Transforms.cs @@ -38,7 +38,7 @@ namespace OpenRA.Mods.RA.Traits public Transforms(ActorInitializer init, TransformsInfo info) { - self = init.self; + self = init.Self; this.info = info; bi = self.World.Map.Rules.Actors[info.IntoActor].Traits.GetOrDefault(); race = init.Contains() ? init.Get() : self.Owner.Country.Race; diff --git a/OpenRA.Mods.RA/UpgradeActorsNear.cs b/OpenRA.Mods.RA/UpgradeActorsNear.cs index 607e50fb82..87ac67bcb1 100644 --- a/OpenRA.Mods.RA/UpgradeActorsNear.cs +++ b/OpenRA.Mods.RA/UpgradeActorsNear.cs @@ -34,7 +34,7 @@ namespace OpenRA.Mods.RA public readonly string EnableSound = null; public readonly string DisableSound = null; - public object Create(ActorInitializer init) { return new UpgradeActorsNear(init.self, this); } + public object Create(ActorInitializer init) { return new UpgradeActorsNear(init.Self, this); } } public class UpgradeActorsNear : ITick, INotifyAddedToWorld, INotifyRemovedFromWorld, INotifyOtherProduction diff --git a/OpenRA.Mods.RA/UtilityCommands/ActorStatsExport.cs b/OpenRA.Mods.RA/UtilityCommands/ActorStatsExport.cs index bb21428d7e..484e8023a2 100644 --- a/OpenRA.Mods.RA/UtilityCommands/ActorStatsExport.cs +++ b/OpenRA.Mods.RA/UtilityCommands/ActorStatsExport.cs @@ -23,7 +23,7 @@ namespace OpenRA.Mods.RA.UtilityCommands { public static DataTable GenerateTable() { - var rules = Game.modData.RulesetCache.LoadDefaultRules(); + var rules = Game.ModData.RulesetCache.LoadDefaultRules(); var table = new DataTable(); table.Columns.Add("Name", typeof(string)); diff --git a/OpenRA.Mods.RA/UtilityCommands/ExportCharacterSeparatedRules.cs b/OpenRA.Mods.RA/UtilityCommands/ExportCharacterSeparatedRules.cs index bae425a62b..cc4f0bafbf 100644 --- a/OpenRA.Mods.RA/UtilityCommands/ExportCharacterSeparatedRules.cs +++ b/OpenRA.Mods.RA/UtilityCommands/ExportCharacterSeparatedRules.cs @@ -20,9 +20,9 @@ namespace OpenRA.Mods.RA.UtilityCommands [Desc("Export the damage per second evaluation into a CSV file for inspection.")] public void Run(ModData modData, string[] args) { - Game.modData = modData; + Game.ModData = modData; var table = ActorStatsExport.GenerateTable(); - var filename = "{0}-mod-dps.csv".F(Game.modData.Manifest.Mod.Id); + var filename = "{0}-mod-dps.csv".F(Game.ModData.Manifest.Mod.Id); using (var outfile = new StreamWriter(filename)) outfile.Write(table.ToCharacterSeparatedValues(";", true)); Console.WriteLine("{0} has been saved.".F(filename)); diff --git a/OpenRA.Mods.RA/Widgets/Logic/DownloadPackagesLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/DownloadPackagesLogic.cs index 59420c4671..f690fb903e 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/DownloadPackagesLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/DownloadPackagesLogic.cs @@ -52,9 +52,9 @@ namespace OpenRA.Mods.RA.Widgets.Logic var cancelButton = panel.Get("CANCEL_BUTTON"); - var mirrorsFile = Platform.ResolvePath("^", "Content", Game.modData.Manifest.Mod.Id, "mirrors.txt"); + var mirrorsFile = Platform.ResolvePath("^", "Content", Game.ModData.Manifest.Mod.Id, "mirrors.txt"); var file = Path.Combine(Path.GetTempPath(), Path.GetRandomFileName()); - var dest = Platform.ResolvePath("^", "Content", Game.modData.Manifest.Mod.Id); + var dest = Platform.ResolvePath("^", "Content", Game.ModData.Manifest.Mod.Id); Action onDownloadProgress = i => { diff --git a/OpenRA.Mods.RA/Widgets/Logic/Ingame/GameInfoBriefingLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/Ingame/GameInfoBriefingLogic.cs index 4826f52de5..95a01ce8a3 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/Ingame/GameInfoBriefingLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/Ingame/GameInfoBriefingLogic.cs @@ -22,7 +22,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic public GameInfoBriefingLogic(Widget widget, World world) { var previewWidget = widget.Get("MAP_PREVIEW"); - previewWidget.Preview = () => Game.modData.MapCache[world.Map.Uid]; + previewWidget.Preview = () => Game.ModData.MapCache[world.Map.Uid]; var mapDescriptionPanel = widget.Get("MAP_DESCRIPTION_PANEL"); var mapDescription = widget.Get("MAP_DESCRIPTION"); diff --git a/OpenRA.Mods.RA/Widgets/Logic/Ingame/LeaveMapLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/Ingame/LeaveMapLogic.cs index 5bd38258a6..b09a1fc1a0 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/Ingame/LeaveMapLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/Ingame/LeaveMapLogic.cs @@ -36,7 +36,7 @@ namespace OpenRA.Mods.RA.Widgets if (mpe != null) mpe.Fade(mpe.Info.MenuEffect); - widget.Get("VERSION_LABEL").Text = Game.modData.Manifest.Mod.Version; + widget.Get("VERSION_LABEL").Text = Game.ModData.Manifest.Mod.Version; var showStats = false; diff --git a/OpenRA.Mods.RA/Widgets/Logic/IngameMenuLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/IngameMenuLogic.cs index 04c9db614f..f728a2dc99 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/IngameMenuLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/IngameMenuLogic.cs @@ -29,7 +29,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic if (mpe != null) mpe.Fade(mpe.Info.MenuEffect); - menu.Get("VERSION_LABEL").Text = Game.modData.Manifest.Mod.Version; + menu.Get("VERSION_LABEL").Text = Game.ModData.Manifest.Mod.Version; var hideMenu = false; menu.Get("MENU_BUTTONS").IsVisible = () => !hideMenu; diff --git a/OpenRA.Mods.RA/Widgets/Logic/InstallFromCDLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/InstallFromCDLogic.cs index 3befb18db1..aff51f02eb 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/InstallFromCDLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/InstallFromCDLogic.cs @@ -46,7 +46,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic bool IsValidDisk(string diskRoot) { - return Game.modData.Manifest.ContentInstaller.DiskTestFiles.All(f => File.Exists(Path.Combine(diskRoot, f))); + return Game.ModData.Manifest.ContentInstaller.DiskTestFiles.All(f => File.Exists(Path.Combine(diskRoot, f))); } void CheckForDisk() @@ -69,14 +69,14 @@ namespace OpenRA.Mods.RA.Widgets.Logic insertDiskContainer.IsVisible = () => false; installingContainer.IsVisible = () => true; - var dest = Platform.ResolvePath("^", "Content", Game.modData.Manifest.Mod.Id); - var copyFiles = Game.modData.Manifest.ContentInstaller.CopyFilesFromCD; + var dest = Platform.ResolvePath("^", "Content", Game.ModData.Manifest.Mod.Id); + var copyFiles = Game.ModData.Manifest.ContentInstaller.CopyFilesFromCD; - var packageToExtract = Game.modData.Manifest.ContentInstaller.PackageToExtractFromCD.Split(':'); + var packageToExtract = Game.ModData.Manifest.ContentInstaller.PackageToExtractFromCD.Split(':'); var extractPackage = packageToExtract.First(); var annotation = packageToExtract.Length > 1 ? packageToExtract.Last() : null; - var extractFiles = Game.modData.Manifest.ContentInstaller.ExtractFilesFromCD; + var extractFiles = Game.ModData.Manifest.ContentInstaller.ExtractFilesFromCD; var installCounter = 0; var installTotal = copyFiles.Count() + extractFiles.Count(); diff --git a/OpenRA.Mods.RA/Widgets/Logic/InstallLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/InstallLogic.cs index 69bfeca4c3..cbafb0d2f9 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/InstallLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/InstallLogic.cs @@ -19,7 +19,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic [ObjectCreator.UseCtor] public InstallLogic(Widget widget, Action continueLoading) { - var mirrorListUrl = Game.modData.Manifest.ContentInstaller.PackageMirrorList; + var mirrorListUrl = Game.ModData.Manifest.ContentInstaller.PackageMirrorList; var panel = widget.Get("INSTALL_PANEL"); var widgetArgs = new WidgetArgs() { @@ -36,7 +36,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic panel.Get("BACK_BUTTON").OnClick = () => { - Game.Settings.Game.PreviousMod = Game.modData.Manifest.Mod.Id; + Game.Settings.Game.PreviousMod = Game.ModData.Manifest.Mod.Id; Game.InitializeMod("modchooser", null); }; } diff --git a/OpenRA.Mods.RA/Widgets/Logic/InstallMusicLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/InstallMusicLogic.cs index 94971f7b52..6ef6fe709a 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/InstallMusicLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/InstallMusicLogic.cs @@ -44,7 +44,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic var downloadButton = installMusicContainer.GetOrNull("DOWNLOAD_BUTTON"); if (downloadButton != null) { - var mirrorListUrl = Game.modData.Manifest.ContentInstaller.MusicPackageMirrorList; + var mirrorListUrl = Game.ModData.Manifest.ContentInstaller.MusicPackageMirrorList; downloadButton.IsVisible = () => !string.IsNullOrEmpty(mirrorListUrl); downloadButton.OnClick = () => { diff --git a/OpenRA.Mods.RA/Widgets/Logic/LobbyLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/LobbyLogic.cs index 7ab9f319a4..58906f09af 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/LobbyLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/LobbyLogic.cs @@ -625,7 +625,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic if (Map.Uid == uid) return; - Map = Game.modData.MapCache[uid]; + Map = Game.ModData.MapCache[uid]; if (Map.Status == MapStatus.Available) { // Maps need to be validated and pre-loaded before they can be accessed @@ -653,7 +653,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic }).Start(); } else if (Game.Settings.Game.AllowDownloading) - Game.modData.MapCache.QueryRemoteMapDetails(new[] { uid }); + Game.ModData.MapCache.QueryRemoteMapDetails(new[] { uid }); } void UpdatePlayerList() diff --git a/OpenRA.Mods.RA/Widgets/Logic/LobbyMapPreviewLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/LobbyMapPreviewLogic.cs index e433a8dcd0..88745755a2 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/LobbyMapPreviewLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/LobbyMapPreviewLogic.cs @@ -143,7 +143,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic if (lobby.Map.Status == MapStatus.DownloadError) lobby.Map.Install(); else if (lobby.Map.Status == MapStatus.Unavailable) - Game.modData.MapCache.QueryRemoteMapDetails(new[] { lobby.Map.Uid }); + Game.ModData.MapCache.QueryRemoteMapDetails(new[] { lobby.Map.Uid }); }; retry.GetText = () => lobby.Map.Status == MapStatus.DownloadError ? "Retry Install" : "Retry Search"; diff --git a/OpenRA.Mods.RA/Widgets/Logic/LobbyUtils.cs b/OpenRA.Mods.RA/Widgets/Logic/LobbyUtils.cs index 39e4839a74..87f45d5863 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/LobbyUtils.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/LobbyUtils.cs @@ -177,7 +177,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic if (!orderManager.LocalClient.IsObserver && orderManager.LocalClient.State == Session.ClientState.Ready) return; - var spawnSize = new float2(ChromeProvider.GetImage("lobby-bits", "spawn-unclaimed").bounds.Size); + var spawnSize = new float2(ChromeProvider.GetImage("lobby-bits", "spawn-unclaimed").Bounds.Size); var selectedSpawn = preview.SpawnPoints .Select((sp, i) => Pair.New(mapPreview.ConvertToPreview(sp), i)) .Where(a => ((a.First - mi.Location).ToFloat2() / spawnSize * 2).LengthSquared <= 1) diff --git a/OpenRA.Mods.RA/Widgets/Logic/MainMenuLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/MainMenuLogic.cs index bfc19c4a26..3197818054 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/MainMenuLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/MainMenuLogic.cs @@ -34,7 +34,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic public MainMenuLogic(Widget widget, World world) { rootMenu = widget; - rootMenu.Get("VERSION_LABEL").Text = Game.modData.Manifest.Mod.Version; + rootMenu.Get("VERSION_LABEL").Text = Game.ModData.Manifest.Mod.Version; // Menu buttons var mainMenu = widget.Get("MAIN_MENU"); @@ -56,7 +56,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic mainMenu.Get("MODS_BUTTON").OnClick = () => { - Game.Settings.Game.PreviousMod = Game.modData.Manifest.Mod.Id; + Game.Settings.Game.PreviousMod = Game.ModData.Manifest.Mod.Id; Game.InitializeMod("modchooser", null); }; @@ -88,8 +88,8 @@ namespace OpenRA.Mods.RA.Widgets.Logic }); }; - var hasCampaign = Game.modData.Manifest.Missions.Any(); - var hasMissions = Game.modData.MapCache + var hasCampaign = Game.ModData.Manifest.Missions.Any(); + var hasMissions = Game.ModData.MapCache .Any(p => p.Status == MapStatus.Available && p.Map.Visibility.HasFlag(MapVisibility.MissionSelector)); missionsButton.Disabled = !hasCampaign && !hasMissions; diff --git a/OpenRA.Mods.RA/Widgets/Logic/MapChooserLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/MapChooserLogic.cs index f7241fb9ce..16a6c2ca8e 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/MapChooserLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/MapChooserLogic.cs @@ -47,7 +47,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic var gameModeDropdown = widget.GetOrNull("GAMEMODE_FILTER"); if (gameModeDropdown != null) { - var selectableMaps = Game.modData.MapCache.Where(m => m.Status == MapStatus.Available && (m.Map.Visibility & filter) != 0); + var selectableMaps = Game.ModData.MapCache.Where(m => m.Status == MapStatus.Available && (m.Map.Visibility & filter) != 0); var gameModes = selectableMaps .GroupBy(m => m.Type) .Select(g => Pair.New(g.Key, g.Count())).ToList(); @@ -111,7 +111,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic void EnumerateMaps(Action onSelect, MapVisibility filter) { - var maps = Game.modData.MapCache + var maps = Game.ModData.MapCache .Where(m => m.Status == MapStatus.Available && (m.Map.Visibility & filter) != 0) .Where(m => gameMode == null || m.Type == gameMode) .Where(m => mapFilter == null || m.Title.IndexOf(mapFilter, StringComparison.OrdinalIgnoreCase) >= 0 || m.Author.IndexOf(mapFilter, StringComparison.OrdinalIgnoreCase) >= 0) diff --git a/OpenRA.Mods.RA/Widgets/Logic/MissionBrowserLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/MissionBrowserLogic.cs index e67c58f02d..b149944646 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/MissionBrowserLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/MissionBrowserLogic.cs @@ -92,15 +92,15 @@ namespace OpenRA.Mods.RA.Widgets.Logic missionList.RemoveChildren(); // Add a group for each campaign - if (Game.modData.Manifest.Missions.Any()) + if (Game.ModData.Manifest.Missions.Any()) { - var yaml = Game.modData.Manifest.Missions.Select(MiniYaml.FromFile).Aggregate(MiniYaml.MergeLiberal); + var yaml = Game.ModData.Manifest.Missions.Select(MiniYaml.FromFile).Aggregate(MiniYaml.MergeLiberal); foreach (var kv in yaml) { var missionMapPaths = kv.Value.Nodes.Select(n => Path.GetFullPath(n.Key)); - var maps = Game.modData.MapCache + var maps = Game.ModData.MapCache .Where(p => p.Status == MapStatus.Available && missionMapPaths.Contains(Path.GetFullPath(p.Map.Path))) .Select(p => p.Map); @@ -110,7 +110,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic } // Add an additional group for loose missions - var looseMissions = Game.modData.MapCache + var looseMissions = Game.ModData.MapCache .Where(p => p.Status == MapStatus.Available && p.Map.Visibility.HasFlag(MapVisibility.MissionSelector) && !allMaps.Contains(p.Map)) .Select(p => p.Map); @@ -158,7 +158,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic void SelectMap(Map map) { - selectedMapPreview = Game.modData.MapCache[map.Uid]; + selectedMapPreview = Game.ModData.MapCache[map.Uid]; // Cache the rules on a background thread to avoid jank new Thread(selectedMapPreview.CacheRules).Start(); diff --git a/OpenRA.Mods.RA/Widgets/Logic/MusicPlayerLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/MusicPlayerLogic.cs index cdbc4250c3..e73115be0e 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/MusicPlayerLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/MusicPlayerLogic.cs @@ -88,11 +88,11 @@ namespace OpenRA.Mods.RA.Widgets.Logic var args = new string[] { "Install.Music=true" }; installButton.OnClick = () => { - Game.modData.LoadScreen.Display(); // HACK: prevent a flicker when transitioning to the installation dialog + Game.ModData.LoadScreen.Display(); // HACK: prevent a flicker when transitioning to the installation dialog Game.InitializeMod(Game.Settings.Game.Mod, new Arguments(args)); }; - var installData = Game.modData.Manifest.ContentInstaller; + var installData = Game.ModData.Manifest.ContentInstaller; installButton.IsVisible = () => modRules.InstalledMusic.ToArray().Length <= installData.ShippedSoundtracks; } diff --git a/OpenRA.Mods.RA/Widgets/Logic/ReplayBrowserLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/ReplayBrowserLogic.cs index 4d0ef79315..1de56a83d9 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/ReplayBrowserLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/ReplayBrowserLogic.cs @@ -47,7 +47,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic replayList = panel.Get("REPLAY_LIST"); var template = panel.Get("REPLAY_TEMPLATE"); - var mod = Game.modData.Manifest.Mod; + var mod = Game.ModData.Manifest.Mod; var dir = Platform.ResolvePath("^", "Replays", mod.Id, mod.Version); replayList.RemoveChildren(); diff --git a/OpenRA.Mods.RA/Widgets/Logic/ServerBrowserLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/ServerBrowserLogic.cs index 4a9c068fad..eb598f257f 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/ServerBrowserLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/ServerBrowserLogic.cs @@ -169,7 +169,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic return 0; // Games for the current mod+version are sorted first - if (testEntry.ModId == Game.modData.Manifest.Mod.Id) + if (testEntry.ModId == Game.ModData.Manifest.Mod.Id) return 2; // Followed by games for different mods that are joinable @@ -208,7 +208,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic var item = ScrollItemWidget.Setup(serverTemplate, () => currentServer == game, () => currentServer = game, () => Join(game)); - var map = Game.modData.MapCache[game.Map]; + var map = Game.ModData.MapCache[game.Map]; var preview = item.GetOrNull("MAP_PREVIEW"); if (preview != null) preview.Preview = () => map; @@ -283,7 +283,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic // Search for any unknown maps if (Game.Settings.Game.AllowDownloading) - Game.modData.MapCache.QueryRemoteMapDetails(games.Where(g => !Filtered(g)).Select(g => g.Map)); + Game.ModData.MapCache.QueryRemoteMapDetails(games.Where(g => !Filtered(g)).Select(g => g.Map)); foreach (var row in rows) serverList.AddChild(row); diff --git a/OpenRA.Mods.RA/Widgets/Logic/ServerCreationLogic.cs b/OpenRA.Mods.RA/Widgets/Logic/ServerCreationLogic.cs index 614b5f5163..8ed5de5021 100644 --- a/OpenRA.Mods.RA/Widgets/Logic/ServerCreationLogic.cs +++ b/OpenRA.Mods.RA/Widgets/Logic/ServerCreationLogic.cs @@ -31,7 +31,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic this.onExit = onExit; var settings = Game.Settings; - preview = Game.modData.MapCache[WidgetUtils.ChooseInitialMap(Game.Settings.Server.Map)]; + preview = Game.ModData.MapCache[WidgetUtils.ChooseInitialMap(Game.Settings.Server.Map)]; panel.Get("BACK_BUTTON").OnClick = () => { Ui.CloseWindow(); onExit(); }; panel.Get("CREATE_BUTTON").OnClick = CreateAndJoin; @@ -45,7 +45,7 @@ namespace OpenRA.Mods.RA.Widgets.Logic { { "initialMap", preview.Uid }, { "onExit", () => { } }, - { "onSelect", (Action)(uid => preview = Game.modData.MapCache[uid]) } + { "onSelect", (Action)(uid => preview = Game.ModData.MapCache[uid]) } }); }; diff --git a/OpenRA.Mods.RA/WithRangeCircle.cs b/OpenRA.Mods.RA/WithRangeCircle.cs index 1d6ed8c474..422e81ac41 100644 --- a/OpenRA.Mods.RA/WithRangeCircle.cs +++ b/OpenRA.Mods.RA/WithRangeCircle.cs @@ -44,7 +44,7 @@ namespace OpenRA.Mods.RA.Traits yield return r; } - public object Create(ActorInitializer init) { return new WithRangeCircle(init.self, this); } + public object Create(ActorInitializer init) { return new WithRangeCircle(init.Self, this); } } class WithRangeCircle : IPostRenderSelection diff --git a/OpenRA.Mods.TS/Traits/Buildings/TiberianSunRefinery.cs b/OpenRA.Mods.TS/Traits/Buildings/TiberianSunRefinery.cs index 8f4a82ec38..41a48c8802 100644 --- a/OpenRA.Mods.TS/Traits/Buildings/TiberianSunRefinery.cs +++ b/OpenRA.Mods.TS/Traits/Buildings/TiberianSunRefinery.cs @@ -17,7 +17,7 @@ namespace OpenRA.Mods.TS.Traits { public class TiberianSunRefineryInfo : OreRefineryInfo { - public override object Create(ActorInitializer init) { return new TiberianSunRefinery(init.self, this); } + public override object Create(ActorInitializer init) { return new TiberianSunRefinery(init.Self, this); } } public class TiberianSunRefinery : OreRefinery diff --git a/OpenRA.Mods.TS/Traits/Render/RenderVoxels.cs b/OpenRA.Mods.TS/Traits/Render/RenderVoxels.cs index 7eeb210096..2444cf0236 100644 --- a/OpenRA.Mods.TS/Traits/Render/RenderVoxels.cs +++ b/OpenRA.Mods.TS/Traits/Render/RenderVoxels.cs @@ -39,7 +39,7 @@ namespace OpenRA.Mods.TS.Traits public readonly float[] LightAmbientColor = new float[] { 0.6f, 0.6f, 0.6f }; public readonly float[] LightDiffuseColor = new float[] { 0.4f, 0.4f, 0.4f }; - public virtual object Create(ActorInitializer init) { return new RenderVoxels(init.self, this); } + public virtual object Create(ActorInitializer init) { return new RenderVoxels(init.Self, this); } public virtual IEnumerable RenderPreview(ActorPreviewInitializer init) { diff --git a/OpenRA.Mods.TS/Traits/Render/WithVoxelBarrel.cs b/OpenRA.Mods.TS/Traits/Render/WithVoxelBarrel.cs index 3d6acc8f04..56ad4d1ba3 100644 --- a/OpenRA.Mods.TS/Traits/Render/WithVoxelBarrel.cs +++ b/OpenRA.Mods.TS/Traits/Render/WithVoxelBarrel.cs @@ -26,7 +26,7 @@ namespace OpenRA.Mods.TS.Traits [Desc("Visual offset")] public readonly WVec LocalOffset = WVec.Zero; - public object Create(ActorInitializer init) { return new WithVoxelBarrel(init.self, this); } + public object Create(ActorInitializer init) { return new WithVoxelBarrel(init.Self, this); } public IEnumerable RenderPreviewVoxels(ActorPreviewInitializer init, RenderVoxelsInfo rv, string image, WRot orientation, int facings, PaletteReference p) { diff --git a/OpenRA.Mods.TS/Traits/Render/WithVoxelBody.cs b/OpenRA.Mods.TS/Traits/Render/WithVoxelBody.cs index d80b1e4307..1b1b915adf 100644 --- a/OpenRA.Mods.TS/Traits/Render/WithVoxelBody.cs +++ b/OpenRA.Mods.TS/Traits/Render/WithVoxelBody.cs @@ -22,7 +22,7 @@ namespace OpenRA.Mods.TS.Traits { public readonly string Sequence = "idle"; - public object Create(ActorInitializer init) { return new WithVoxelBody(init.self, this); } + public object Create(ActorInitializer init) { return new WithVoxelBody(init.Self, this); } public IEnumerable RenderPreviewVoxels(ActorPreviewInitializer init, RenderVoxelsInfo rv, string image, WRot orientation, int facings, PaletteReference p) { diff --git a/OpenRA.Mods.TS/Traits/Render/WithVoxelTurret.cs b/OpenRA.Mods.TS/Traits/Render/WithVoxelTurret.cs index 13cb7e88cb..a2e17b7070 100644 --- a/OpenRA.Mods.TS/Traits/Render/WithVoxelTurret.cs +++ b/OpenRA.Mods.TS/Traits/Render/WithVoxelTurret.cs @@ -25,7 +25,7 @@ namespace OpenRA.Mods.TS.Traits [Desc("Turreted 'Turret' key to display")] public readonly string Turret = "primary"; - public object Create(ActorInitializer init) { return new WithVoxelTurret(init.self, this); } + public object Create(ActorInitializer init) { return new WithVoxelTurret(init.Self, this); } public IEnumerable RenderPreviewVoxels(ActorPreviewInitializer init, RenderVoxelsInfo rv, string image, WRot orientation, int facings, PaletteReference p) { diff --git a/OpenRA.Mods.TS/Traits/Render/WithVoxelUnloadBody.cs b/OpenRA.Mods.TS/Traits/Render/WithVoxelUnloadBody.cs index bda835110f..4950b230a4 100644 --- a/OpenRA.Mods.TS/Traits/Render/WithVoxelUnloadBody.cs +++ b/OpenRA.Mods.TS/Traits/Render/WithVoxelUnloadBody.cs @@ -25,7 +25,7 @@ namespace OpenRA.Mods.TS.Traits [Desc("Voxel sequence name to use when undocked from a refinery.")] public readonly string IdleSequence = "idle"; - public object Create(ActorInitializer init) { return new WithVoxelUnloadBody(init.self, this); } + public object Create(ActorInitializer init) { return new WithVoxelUnloadBody(init.Self, this); } public IEnumerable RenderPreviewVoxels(ActorPreviewInitializer init, RenderVoxelsInfo rv, string image, WRot orientation, int facings, PaletteReference p) { diff --git a/OpenRA.Mods.TS/Traits/Render/WithVoxelWalkerBody.cs b/OpenRA.Mods.TS/Traits/Render/WithVoxelWalkerBody.cs index 9cc6e07b4c..c12506e910 100644 --- a/OpenRA.Mods.TS/Traits/Render/WithVoxelWalkerBody.cs +++ b/OpenRA.Mods.TS/Traits/Render/WithVoxelWalkerBody.cs @@ -18,7 +18,7 @@ namespace OpenRA.Mods.TS.Traits public class WithVoxelWalkerBodyInfo : ITraitInfo, IQuantizeBodyOrientationInfo, Requires, Requires { public readonly int TickRate = 5; - public object Create(ActorInitializer init) { return new WithVoxelWalkerBody(init.self, this); } + public object Create(ActorInitializer init) { return new WithVoxelWalkerBody(init.Self, this); } public int QuantizedBodyFacings(SequenceProvider sequenceProvider, ActorInfo ai) { return 0; } } diff --git a/OpenRA.Mods.TS/UtilityCommands/LegacyTilesetImporter.cs b/OpenRA.Mods.TS/UtilityCommands/LegacyTilesetImporter.cs index faab6979e7..551c7706ed 100644 --- a/OpenRA.Mods.TS/UtilityCommands/LegacyTilesetImporter.cs +++ b/OpenRA.Mods.TS/UtilityCommands/LegacyTilesetImporter.cs @@ -25,9 +25,9 @@ namespace OpenRA.Mods.TS.UtilityCommands public void Run(ModData modData, string[] args) { // HACK: The engine code assumes that Game.modData is set. - Game.modData = modData; + Game.ModData = modData; - GlobalFileSystem.LoadFromManifest(Game.modData.Manifest); + GlobalFileSystem.LoadFromManifest(Game.ModData.Manifest); var file = new IniFile(File.Open(args[1], FileMode.Open));
PropertyDefault ValueTypeDescription