Remove FootprintUtils
This commit is contained in:
@@ -47,28 +47,28 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
|
||||
class WithGateSpriteBody : WithSpriteBody, INotifyRemovedFromWorld, IWallConnector, ITick
|
||||
{
|
||||
readonly WithGateSpriteBodyInfo gateInfo;
|
||||
readonly WithGateSpriteBodyInfo gateBodyInfo;
|
||||
readonly Gate gate;
|
||||
bool renderOpen;
|
||||
|
||||
public WithGateSpriteBody(ActorInitializer init, WithGateSpriteBodyInfo info)
|
||||
: base(init, info, () => 0)
|
||||
{
|
||||
gateInfo = info;
|
||||
gateBodyInfo = info;
|
||||
gate = init.Self.Trait<Gate>();
|
||||
}
|
||||
|
||||
void UpdateState(Actor self)
|
||||
{
|
||||
if (renderOpen)
|
||||
DefaultAnimation.PlayRepeating(NormalizeSequence(self, gateInfo.OpenSequence));
|
||||
DefaultAnimation.PlayRepeating(NormalizeSequence(self, gateBodyInfo.OpenSequence));
|
||||
else
|
||||
DefaultAnimation.PlayFetchIndex(NormalizeSequence(self, Info.Sequence), GetGateFrame);
|
||||
}
|
||||
|
||||
void ITick.Tick(Actor self)
|
||||
{
|
||||
if (gateInfo.OpenSequence == null)
|
||||
if (gateBodyInfo.OpenSequence == null)
|
||||
return;
|
||||
|
||||
if (gate.Position == gate.OpenPosition ^ renderOpen)
|
||||
@@ -96,7 +96,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
|
||||
void UpdateNeighbours(Actor self)
|
||||
{
|
||||
var footprint = FootprintUtils.Tiles(self).ToArray();
|
||||
var footprint = gate.Info.Tiles(self.Location).ToArray();
|
||||
var adjacent = Util.ExpandFootprint(footprint, true).Except(footprint)
|
||||
.Where(self.World.Map.Contains).ToList();
|
||||
|
||||
@@ -115,7 +115,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
||||
bool IWallConnector.AdjacentWallCanConnect(Actor self, CPos wallLocation, string wallType, out CVec facing)
|
||||
{
|
||||
facing = wallLocation - self.Location;
|
||||
return wallType == gateInfo.Type && gateInfo.WallConnections.Contains(facing);
|
||||
return wallType == gateBodyInfo.Type && gateBodyInfo.WallConnections.Contains(facing);
|
||||
}
|
||||
|
||||
void IWallConnector.SetDirty() { }
|
||||
|
||||
Reference in New Issue
Block a user