namespace AcDream.App.Physics;
internal enum LiveEntityVectorRoute
{
Projectile,
CanonicalBody,
OrdinaryRemote,
}
///
/// Pins retail's one-CPhysicsObj vector-update priority. A missile owns its
/// canonical body first; otherwise a retained static body consumes the wire
/// vector; only an ordinary remote reaches MovementManager storage.
///
internal static class LiveEntityVectorRouter
{
internal static LiveEntityVectorRoute Route(
Func tryProjectile,
Func tryCanonicalBody,
Action applyOrdinaryRemote)
{
ArgumentNullException.ThrowIfNull(tryProjectile);
ArgumentNullException.ThrowIfNull(tryCanonicalBody);
ArgumentNullException.ThrowIfNull(applyOrdinaryRemote);
if (tryProjectile())
return LiveEntityVectorRoute.Projectile;
if (tryCanonicalBody())
return LiveEntityVectorRoute.CanonicalBody;
applyOrdinaryRemote();
return LiveEntityVectorRoute.OrdinaryRemote;
}
}