attack if in range of any cell of a building

This commit is contained in:
Bob
2010-11-03 21:06:55 +13:00
committed by Chris Forbes
parent c3fc7b98f3
commit 50b1ba3acc
8 changed files with 56 additions and 7 deletions

View File

@@ -0,0 +1,26 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using OpenRA.Traits;
namespace OpenRA.Mods.RA
{
class TargetableBuildingInfo : TargetableInfo, ITraitPrerequisite<BuildingInfo>
{
public override object Create( ActorInitializer init ) { return new TargetableBuilding( this ); }
}
class TargetableBuilding : Targetable
{
public TargetableBuilding( TargetableBuildingInfo info )
: base( info )
{
}
public override IEnumerable<int2> TargetableSquares( Actor self )
{
return self.Trait<Building>().OccupiedCells();
}
}
}