Added cache for cell cost and blocking

This commit is contained in:
teinarss
2019-07-07 19:57:13 +02:00
committed by reaperrr
parent fb1af81280
commit cc84daacea
9 changed files with 305 additions and 102 deletions

View File

@@ -225,6 +225,16 @@ namespace OpenRA.Mods.Common.Traits
return self.IsAtGroundLevel() && crushClasses.Contains(info.CrushClass);
}
bool ICrushable.TryCalculatePlayerBlocking(Actor self, BitSet<CrushClass> crushClasses, out LongBitSet<PlayerBitMask> blocking)
{
if (self.IsAtGroundLevel() && crushClasses.Contains(info.CrushClass))
blocking = default(LongBitSet<PlayerBitMask>);
else
blocking = self.World.AllPlayerMask;
return true;
}
void INotifyAddedToWorld.AddedToWorld(Actor self)
{
self.World.AddToMaps(self, this);