This commit is contained in:
Chris Forbes
2010-12-20 19:32:00 +13:00
parent bd0b3edccb
commit 2d2bb58054

View File

@@ -62,14 +62,14 @@ namespace OpenRA.Mods.RA.Buildings
}
}
public class Building : INotifyDamage, IResolveOrder, IOccupySpace
public class Building : INotifyDamage, IResolveOrder, IOccupySpace, INotifyCapture
{
readonly Actor self;
public readonly BuildingInfo Info;
[Sync]
readonly int2 topLeft;
readonly PowerManager PlayerPower;
PowerManager PlayerPower;
public int2 PxPosition { get { return ( 2 * topLeft + Info.Dimensions ) * Game.CellSize / 2; } }
@@ -121,5 +121,10 @@ namespace OpenRA.Mods.RA.Buildings
{
return FootprintUtils.UnpathableTiles( self.Info.Name, Info, TopLeft );
}
public void OnCapture(Actor self, Actor captor, Player oldOwner, Player newOwner)
{
PlayerPower = newOwner.PlayerActor.Trait<PowerManager>();
}
}
}