Split Locomotor trait from Mobile
Add GrantConditionOn*Layer traits This allows to - drop some booleans from Locomotor - drop a good part of the subterranean- and jumpjet-specific code/hacks from Mobile - grant more than 1 condition per layer type (via multiple traits) - easily add more traits of this kind for other layers
This commit is contained in:
@@ -69,7 +69,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
}
|
||||
}
|
||||
|
||||
bool ICustomMovementLayer.EnabledForActor(ActorInfo a, MobileInfo mi) { return enabled; }
|
||||
bool ICustomMovementLayer.EnabledForActor(ActorInfo a, LocomotorInfo li) { return enabled; }
|
||||
byte ICustomMovementLayer.Index { get { return CustomMovementLayerType.ElevatedBridge; } }
|
||||
bool ICustomMovementLayer.InteractsWithDefaultLayer { get { return true; } }
|
||||
|
||||
@@ -78,12 +78,12 @@ namespace OpenRA.Mods.Common.Traits
|
||||
return cellCenters[cell];
|
||||
}
|
||||
|
||||
int ICustomMovementLayer.EntryMovementCost(ActorInfo a, MobileInfo mi, CPos cell)
|
||||
int ICustomMovementLayer.EntryMovementCost(ActorInfo a, LocomotorInfo li, CPos cell)
|
||||
{
|
||||
return ends.Contains(cell) ? 0 : int.MaxValue;
|
||||
}
|
||||
|
||||
int ICustomMovementLayer.ExitMovementCost(ActorInfo a, MobileInfo mi, CPos cell)
|
||||
int ICustomMovementLayer.ExitMovementCost(ActorInfo a, LocomotorInfo li, CPos cell)
|
||||
{
|
||||
return ends.Contains(cell) ? 0 : int.MaxValue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user