feat(vfx): port retail hidden and teleport presentation
Preserve canonical live-object ownership across Hidden transitions and remote teleport placement so effects, collision, streaming, and targeting remain synchronized.
This commit is contained in:
parent
a51ebc66e9
commit
1e98d81448
46 changed files with 4883 additions and 127 deletions
33
src/AcDream.App/World/LiveEntityTeardown.cs
Normal file
33
src/AcDream.App/World/LiveEntityTeardown.cs
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
namespace AcDream.App.World;
|
||||
|
||||
/// <summary>
|
||||
/// Runs the independent owners that participate in one live incarnation's
|
||||
/// teardown without letting an earlier callback strand later state. Retail's
|
||||
/// object destruction drains these owners as separate lifecycle steps; the App
|
||||
/// composition callback must preserve that symmetry even when a plugin,
|
||||
/// renderer, or effect sink throws.
|
||||
/// </summary>
|
||||
internal static class LiveEntityTeardown
|
||||
{
|
||||
internal static void Run(IEnumerable<Action> cleanups)
|
||||
{
|
||||
ArgumentNullException.ThrowIfNull(cleanups);
|
||||
List<Exception>? failures = null;
|
||||
foreach (Action cleanup in cleanups)
|
||||
{
|
||||
try
|
||||
{
|
||||
cleanup();
|
||||
}
|
||||
catch (Exception error)
|
||||
{
|
||||
(failures ??= []).Add(error);
|
||||
}
|
||||
}
|
||||
|
||||
if (failures is not null)
|
||||
throw new AggregateException(
|
||||
"One or more live-entity component teardown steps failed.",
|
||||
failures);
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue