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

@@ -10,6 +10,7 @@
using System;
using System.Collections.Generic;
using System.Drawing;
using System.Linq;
using OpenRA.Effects;
using OpenRA.GameRules;
@@ -47,7 +48,7 @@ namespace OpenRA.Traits
public object Create(ActorInitializer init) { return new Building(init); }
}
public class Building : INotifyDamage, IResolveOrder, ITick, IRenderModifier, IOccupySpace
public class Building : INotifyDamage, IResolveOrder, ITick, IRenderModifier, IOccupySpace, IRadarSignature
{
readonly Actor self;
public readonly BuildingInfo Info;
@@ -160,5 +161,15 @@ namespace OpenRA.Traits
{
return Footprint.UnpathableTiles( self.Info.Name, Info, TopLeft );
}
public IEnumerable<int2> RadarSignatureCells(Actor self)
{
return Footprint.Tiles(self);
}
public Color RadarSignatureColor(Actor self)
{
return self.Owner.Color;
}
}
}