moving Actor.Location onto the appropriate traits (bob)

This commit is contained in:
Chris Forbes
2010-06-19 14:37:06 +12:00
parent db465e1fdd
commit 66adbee2a6
25 changed files with 218 additions and 103 deletions

View File

@@ -32,17 +32,16 @@ namespace OpenRA.Mods.RA
public object Create(ActorInitializer init) { return new Wall(init.self); }
}
public class Wall : ICrushable, IOccupySpace, IBlocksBullets
public class Wall : ICrushable, IBlocksBullets
{
readonly Actor self;
public Wall(Actor self)
{
this.self = self;
self.World.WorldActor.traits.Get<UnitInfluence>().Add(self, this);
self.World.WorldActor.traits.Get<UnitInfluence>().Add(self, self.traits.Get<Building>());
}
public IEnumerable<int2> OccupiedCells() { yield return self.Location; }
public void OnCrush(Actor crusher) { self.InflictDamage(crusher, self.Health, null); }
public bool IsCrushableBy(UnitMovementType umt, Player player)
{