From 040d2513506c7944627f19e1895a8035bee97997 Mon Sep 17 00:00:00 2001 From: Chris Forbes Date: Sun, 10 Jan 2010 13:28:46 +1300 Subject: [PATCH] everything StoresOreInfo onward --- OpenRa.Game/OpenRa.Game.csproj | 1 - OpenRa.Game/Traits/StoresOre.cs | 17 +++++++++-------- OpenRa.Game/Traits/Submarine.cs | 5 +++++ OpenRa.Game/Traits/TakeCover.cs | 5 +++++ OpenRa.Game/Traits/Thief.cs | 5 +++++ OpenRa.Game/Traits/Tree.cs | 20 -------------------- OpenRa.Game/Traits/WaterPaletteRotation.cs | 5 +++++ OpenRa.Game/Traits/WithShadow.cs | 5 +++++ 8 files changed, 34 insertions(+), 29 deletions(-) delete mode 100644 OpenRa.Game/Traits/Tree.cs diff --git a/OpenRa.Game/OpenRa.Game.csproj b/OpenRa.Game/OpenRa.Game.csproj index f43e6f6383..c2a351bf94 100644 --- a/OpenRa.Game/OpenRa.Game.csproj +++ b/OpenRa.Game/OpenRa.Game.csproj @@ -271,7 +271,6 @@ - diff --git a/OpenRa.Game/Traits/StoresOre.cs b/OpenRa.Game/Traits/StoresOre.cs index bdabfca5d2..fad732b83c 100644 --- a/OpenRa.Game/Traits/StoresOre.cs +++ b/OpenRa.Game/Traits/StoresOre.cs @@ -3,16 +3,17 @@ using System; using OpenRa.Game.GameRules; namespace OpenRa.Game.Traits { + class StoresOreInfo : ITraitInfo + { + public readonly int Pips = 0; + public readonly int Capacity = 0; + + public object Create(Actor self) { return new StoresOre(self); } + } + class StoresOre : IPips, IAcceptThief { - public const int MaxStealAmount = 100; //todo: How is cash stolen determined? - - readonly Actor self; - - public StoresOre(Actor self) - { - this.self = self; - } + public StoresOre(Actor self) {} public void OnSteal(Actor self, Actor thief) { diff --git a/OpenRa.Game/Traits/Submarine.cs b/OpenRa.Game/Traits/Submarine.cs index 3183072b85..79033ed5b5 100644 --- a/OpenRa.Game/Traits/Submarine.cs +++ b/OpenRa.Game/Traits/Submarine.cs @@ -4,6 +4,11 @@ using OpenRa.Game.Graphics; namespace OpenRa.Game.Traits { + class SubmarineInfo : ITraitInfo + { + public object Create(Actor self) { return new Submarine(self); } + } + class Submarine : IRenderModifier, INotifyAttack, ITick, INotifyDamage { [Sync] diff --git a/OpenRa.Game/Traits/TakeCover.cs b/OpenRa.Game/Traits/TakeCover.cs index 192f2e899b..abd2148592 100644 --- a/OpenRa.Game/Traits/TakeCover.cs +++ b/OpenRa.Game/Traits/TakeCover.cs @@ -1,6 +1,11 @@  namespace OpenRa.Game.Traits { + class TakeCoverInfo : ITraitInfo + { + public object Create(Actor self) { return new TakeCover(self); } + } + // infantry prone behavior class TakeCover : ITick, INotifyDamage, IDamageModifier, ISpeedModifier { diff --git a/OpenRa.Game/Traits/Thief.cs b/OpenRa.Game/Traits/Thief.cs index 54b34b5d5c..591391a164 100644 --- a/OpenRa.Game/Traits/Thief.cs +++ b/OpenRa.Game/Traits/Thief.cs @@ -3,6 +3,11 @@ using System.Collections.Generic; using System.Linq; namespace OpenRa.Game.Traits { + class ThiefInfo : ITraitInfo + { + public object Create(Actor self) { return new Thief(self); } + } + class Thief : IIssueOrder, IResolveOrder { public Thief(Actor self) { } diff --git a/OpenRa.Game/Traits/Tree.cs b/OpenRa.Game/Traits/Tree.cs deleted file mode 100644 index f4c3ebced1..0000000000 --- a/OpenRa.Game/Traits/Tree.cs +++ /dev/null @@ -1,20 +0,0 @@ -using System.Collections.Generic; -using OpenRa.Game.Graphics; - -namespace OpenRa.Game.Traits -{ - class Tree : IRender - { - Sprite Image; - - public Tree(Sprite treeImage) - { - Image = treeImage; - } - - public IEnumerable Render(Actor self) - { - yield return new Renderable(Image, Game.CellSize * (float2)self.Location, 0); - } - } -} diff --git a/OpenRa.Game/Traits/WaterPaletteRotation.cs b/OpenRa.Game/Traits/WaterPaletteRotation.cs index ec31812731..7c5a5eacf9 100644 --- a/OpenRa.Game/Traits/WaterPaletteRotation.cs +++ b/OpenRa.Game/Traits/WaterPaletteRotation.cs @@ -2,6 +2,11 @@ namespace OpenRa.Game.Traits { + class WaterPaletteRotationInfo : ITraitInfo + { + public object Create(Actor self) { return new WaterPaletteRotation(self); } + } + class WaterPaletteRotation : ITick, IPaletteModifier { public WaterPaletteRotation(Actor self) { } diff --git a/OpenRa.Game/Traits/WithShadow.cs b/OpenRa.Game/Traits/WithShadow.cs index 7575573781..39153ba058 100644 --- a/OpenRa.Game/Traits/WithShadow.cs +++ b/OpenRa.Game/Traits/WithShadow.cs @@ -6,6 +6,11 @@ using OpenRa.Game.Graphics; namespace OpenRa.Game.Traits { + class WithShadowInfo : ITraitInfo + { + public object Create(Actor self) { return new WithShadow(self); } + } + class WithShadow : IRenderModifier { public WithShadow(Actor self) {}