feat(headless): share immutable gameplay content
This commit is contained in:
parent
12b500d383
commit
9569dadb57
25 changed files with 1031 additions and 429 deletions
|
|
@ -45,7 +45,7 @@ public sealed class RuntimeDatCollection : IDatReaderWriter
|
|||
{
|
||||
private readonly DatCollection _raw;
|
||||
private readonly DatCollectionAdapter _bounded;
|
||||
private bool _disposed;
|
||||
private int _disposeStage;
|
||||
|
||||
internal RuntimeDatCollection(DatCollection raw)
|
||||
{
|
||||
|
|
@ -95,11 +95,22 @@ public sealed class RuntimeDatCollection : IDatReaderWriter
|
|||
|
||||
public void Dispose()
|
||||
{
|
||||
if (_disposed)
|
||||
return;
|
||||
|
||||
_disposed = true;
|
||||
_bounded.Dispose();
|
||||
_raw.Dispose();
|
||||
while (_disposeStage < 2)
|
||||
{
|
||||
switch (_disposeStage)
|
||||
{
|
||||
case 0:
|
||||
_bounded.Dispose();
|
||||
_disposeStage++;
|
||||
break;
|
||||
case 1:
|
||||
_raw.Dispose();
|
||||
_disposeStage++;
|
||||
break;
|
||||
default:
|
||||
throw new InvalidOperationException(
|
||||
"Unknown DAT owner teardown stage.");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue