diff --git a/OpenRA.Game/OpenRA.Game.csproj b/OpenRA.Game/OpenRA.Game.csproj index a36ae3e4a3..644b0db4bf 100755 --- a/OpenRA.Game/OpenRA.Game.csproj +++ b/OpenRA.Game/OpenRA.Game.csproj @@ -1,4 +1,4 @@ - + Debug @@ -176,7 +176,6 @@ - @@ -258,4 +257,7 @@ --> + + + \ No newline at end of file diff --git a/OpenRA.Game/Traits/Building.cs b/OpenRA.Game/Traits/Building.cs index e35fe99e6e..154f085bbf 100644 --- a/OpenRA.Game/Traits/Building.cs +++ b/OpenRA.Game/Traits/Building.cs @@ -38,7 +38,7 @@ namespace OpenRA.Traits public object Create(ActorInitializer init) { return new Building(init); } } - public class Building : INotifyDamage, IResolveOrder, IRenderModifier, IOccupySpace, IRadarSignature + public class Building : INotifyDamage, IResolveOrder, IRenderModifier, IOccupySpace { readonly Actor self; public readonly BuildingInfo Info; @@ -113,19 +113,5 @@ namespace OpenRA.Traits { return Footprint.UnpathableTiles( self.Info.Name, Info, TopLeft ); } - - public IEnumerable RadarSignatureCells(Actor self) - { - return Footprint.Tiles(self); - } - - public Color RadarSignatureColor(Actor self) - { - var mod = self.traits.WithInterface().FirstOrDefault(); - if (mod != null) - return mod.RadarColorOverride(self); - - return self.Owner.Color; - } } } diff --git a/OpenRA.Game/Traits/Mobile.cs b/OpenRA.Game/Traits/Mobile.cs index 8187bf3edc..3642e52877 100644 --- a/OpenRA.Game/Traits/Mobile.cs +++ b/OpenRA.Game/Traits/Mobile.cs @@ -17,7 +17,7 @@ using OpenRA.Traits.Activities; namespace OpenRA.Traits { - public class MobileInfo : ITraitInfo, ITraitPrerequisite + public class MobileInfo : ITraitInfo { public readonly string[] TerrainTypes; public readonly float[] TerrainSpeeds; diff --git a/OpenRA.Game/Traits/Unit.cs b/OpenRA.Mods.RA/AppearsOnRadar.cs similarity index 68% rename from OpenRA.Game/Traits/Unit.cs rename to OpenRA.Mods.RA/AppearsOnRadar.cs index 86b116cc2a..2feeb38a9a 100755 --- a/OpenRA.Game/Traits/Unit.cs +++ b/OpenRA.Mods.RA/AppearsOnRadar.cs @@ -11,19 +11,20 @@ using System.Collections.Generic; using System.Drawing; using System.Linq; +using OpenRA.Traits; -namespace OpenRA.Traits +namespace OpenRA.Mods.RA { - public class UnitInfo : ITraitInfo - { - public object Create( ActorInitializer init ) { return new Unit(); } - } + public class AppearsOnRadarInfo : TraitInfo {} + public class AppearsOnRadar : IRadarSignature + { + IOccupySpace Space; - public class Unit : IRadarSignature - { public IEnumerable RadarSignatureCells(Actor self) - { - yield return self.Location; + { + if (Space == null) + Space = self.traits.Get(); + return Space.OccupiedCells(); } public Color RadarSignatureColor(Actor self) @@ -35,4 +36,4 @@ namespace OpenRA.Traits return self.Owner.Color; } } -} +} \ No newline at end of file diff --git a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj index cda2724e98..f030ae46a0 100644 --- a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj +++ b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj @@ -233,6 +233,7 @@ + @@ -244,9 +245,6 @@ OpenRA.Game - - -