New interface for things that show on radar; groundwork for future patches.

This commit is contained in:
Paul Chote
2010-07-22 10:40:23 +12:00
parent 31d5d18d65
commit a234dd4382
4 changed files with 42 additions and 10 deletions

View File

@@ -8,6 +8,9 @@
*/
#endregion
using System.Collections.Generic;
using System.Drawing;
namespace OpenRA.Traits
{
public class UnitInfo : OwnedActorInfo, ITraitInfo
@@ -19,7 +22,7 @@ namespace OpenRA.Traits
public object Create( ActorInitializer init ) { return new Unit(); }
}
public class Unit : INotifyDamage
public class Unit : INotifyDamage, IRadarSignature
{
[Sync]
public int Facing;
@@ -32,5 +35,15 @@ namespace OpenRA.Traits
if (self.Owner == self.World.LocalPlayer)
Sound.PlayVoice("Lost", self);
}
public IEnumerable<int2> RadarSignatureCells(Actor self)
{
yield return self.Location;
}
public Color RadarSignatureColor(Actor self)
{
return self.Owner.Color;
}
}
}