handle case where storages are created after snapshot
parent
2d333d0651
commit
d8d021060e
|
@ -43,6 +43,20 @@ public class Snapshot
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// clear all component storages in case any were created after snapshot
|
||||||
|
// FIXME: this can be eliminated via component discovery
|
||||||
|
foreach (var (typeId, componentStorage) in world.ComponentIndex)
|
||||||
|
{
|
||||||
|
componentStorage.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
// clear all relation storages in case any were created after snapshot
|
||||||
|
// FIXME: this can be eliminated via component discovery
|
||||||
|
foreach (var (typeId, relationStorage) in world.RelationIndex)
|
||||||
|
{
|
||||||
|
relationStorage.Clear();
|
||||||
|
}
|
||||||
|
|
||||||
// restore components
|
// restore components
|
||||||
foreach (var (typeId, componentSnapshot) in ComponentSnapshots)
|
foreach (var (typeId, componentSnapshot) in ComponentSnapshots)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in New Issue