diff --git a/OpenRa.Game/Game.cs b/OpenRa.Game/Game.cs index 0f513f3da6..fc88c0922a 100644 --- a/OpenRa.Game/Game.cs +++ b/OpenRa.Game/Game.cs @@ -8,7 +8,6 @@ using OpenRa.Game.GameRules; using OpenRa.Game.Graphics; using OpenRa.Game.Support; using OpenRa.Game.Traits; -using System.Windows.Forms; namespace OpenRa.Game { diff --git a/OpenRa.Game/Graphics/Animation.cs b/OpenRa.Game/Graphics/Animation.cs index 4bde122441..56d4c797a6 100644 --- a/OpenRa.Game/Graphics/Animation.cs +++ b/OpenRa.Game/Graphics/Animation.cs @@ -26,18 +26,11 @@ namespace OpenRa.Game.Graphics } } - public float2 Center { get { return 0.25f * new float2(CurrentSequence.GetSprite(0).bounds.Size); } } - public void Play( string sequenceName ) { PlayThen(sequenceName, () => { }); } - public void PlayBackwards(string sequenceName) - { - PlayBackwardsThen(sequenceName, () => { }); - } - public void PlayRepeating( string sequenceName ) { PlayThen( sequenceName, () => PlayRepeating( CurrentSequence.Name ) ); diff --git a/OpenRa.Game/Graphics/CursorSheetBuilder.cs b/OpenRa.Game/Graphics/CursorSheetBuilder.cs index 513391d135..333a225da9 100644 --- a/OpenRa.Game/Graphics/CursorSheetBuilder.cs +++ b/OpenRa.Game/Graphics/CursorSheetBuilder.cs @@ -1,7 +1,6 @@ -using System.Collections.Generic; -using OpenRa.FileFormats; -using System.Linq; +using System.Linq; using IjwFramework.Collections; +using OpenRa.FileFormats; namespace OpenRa.Game.Graphics { diff --git a/OpenRa.Game/Graphics/SpriteSheetBuilder.cs b/OpenRa.Game/Graphics/SpriteSheetBuilder.cs index 77e9e11eff..276ce6d90b 100644 --- a/OpenRa.Game/Graphics/SpriteSheetBuilder.cs +++ b/OpenRa.Game/Graphics/SpriteSheetBuilder.cs @@ -1,7 +1,6 @@ -using System.Collections.Generic; -using OpenRa.FileFormats; -using IjwFramework.Collections; using System.Linq; +using IjwFramework.Collections; +using OpenRa.FileFormats; namespace OpenRa.Game.Graphics { diff --git a/OpenRa.Game/Traits/AttackInfo.cs b/OpenRa.Game/Traits/AttackInfo.cs index 52ad8177d5..e1e7ce6f92 100644 --- a/OpenRa.Game/Traits/AttackInfo.cs +++ b/OpenRa.Game/Traits/AttackInfo.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using OpenRa.Game.GameRules; +using OpenRa.Game.GameRules; namespace OpenRa.Game.Traits { diff --git a/OpenRa.Game/Traits/TakeCover.cs b/OpenRa.Game/Traits/TakeCover.cs index a8aafe9ca8..59cba709aa 100644 --- a/OpenRa.Game/Traits/TakeCover.cs +++ b/OpenRa.Game/Traits/TakeCover.cs @@ -1,9 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using OpenRa.Game.GameRules; - + namespace OpenRa.Game.Traits { // infantry prone behavior diff --git a/OpenRa.Game/Traits/TraitsInterfaces.cs b/OpenRa.Game/Traits/TraitsInterfaces.cs index fd3c22a3bc..9485b850d2 100644 --- a/OpenRa.Game/Traits/TraitsInterfaces.cs +++ b/OpenRa.Game/Traits/TraitsInterfaces.cs @@ -1,7 +1,7 @@ using System.Collections.Generic; +using System.Drawing; using OpenRa.Game.GameRules; using OpenRa.Game.Graphics; -using System.Drawing; namespace OpenRa.Game.Traits { @@ -10,29 +10,6 @@ namespace OpenRa.Game.Traits // depends on the order of pips in WorldRenderer.cs! enum PipType { Transparent, Green, Yellow, Red, Gray }; enum TagType { None, Fake, Primary }; - - struct Renderable - { - public readonly Sprite Sprite; - public readonly float2 Pos; - public readonly PaletteType Palette; - public readonly int ZOffset; - - public Renderable(Sprite sprite, float2 pos, PaletteType palette, int zOffset) - { - Sprite = sprite; - Pos = pos; - Palette = palette; - ZOffset = zOffset; - } - - public Renderable(Sprite sprite, float2 pos, PaletteType palette) - : this(sprite, pos, palette, 0) { } - - public Renderable WithPalette(PaletteType newPalette) { return new Renderable(Sprite, Pos, newPalette, ZOffset); } - public Renderable WithZOffset(int newOffset) { return new Renderable(Sprite, Pos, Palette, newOffset); } - public Renderable WithPos(float2 newPos) { return new Renderable(Sprite, newPos, Palette, ZOffset); } - } interface ITick { void Tick(Actor self); } interface IRender { IEnumerable Render(Actor self); } @@ -65,4 +42,27 @@ namespace OpenRa.Game.Traits bool IsCrushableBy(UnitMovementType umt, Player player); bool IsPathableCrush(UnitMovementType umt, Player player); } + + struct Renderable + { + public readonly Sprite Sprite; + public readonly float2 Pos; + public readonly PaletteType Palette; + public readonly int ZOffset; + + public Renderable(Sprite sprite, float2 pos, PaletteType palette, int zOffset) + { + Sprite = sprite; + Pos = pos; + Palette = palette; + ZOffset = zOffset; + } + + public Renderable(Sprite sprite, float2 pos, PaletteType palette) + : this(sprite, pos, palette, 0) { } + + public Renderable WithPalette(PaletteType newPalette) { return new Renderable(Sprite, Pos, newPalette, ZOffset); } + public Renderable WithZOffset(int newOffset) { return new Renderable(Sprite, Pos, Palette, newOffset); } + public Renderable WithPos(float2 newPos) { return new Renderable(Sprite, newPos, Palette, ZOffset); } + } } diff --git a/OpenRa.Game/Traits/Util.cs b/OpenRa.Game/Traits/Util.cs index 9899519a3c..8809c86d90 100755 --- a/OpenRa.Game/Traits/Util.cs +++ b/OpenRa.Game/Traits/Util.cs @@ -1,7 +1,7 @@ using System; using System.Linq; -using OpenRa.Game.Graphics; using OpenRa.Game.GameRules; +using OpenRa.Game.Graphics; namespace OpenRa.Game.Traits { diff --git a/OpenRa.Game/Traits/WaterPaletteRotation.cs b/OpenRa.Game/Traits/WaterPaletteRotation.cs index 02f7cf84b5..ec31812731 100644 --- a/OpenRa.Game/Traits/WaterPaletteRotation.cs +++ b/OpenRa.Game/Traits/WaterPaletteRotation.cs @@ -1,8 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Drawing; +using System.Drawing; namespace OpenRa.Game.Traits {