public static void ReleaseWorld(ref World <State> world) { var state = world.GetState(); WorldUtilities.ReleaseWorld(ref world); TestsHelper.TestStateIsClean(state); }
public static void CompleteWorld(World world) { world.SaveResetState <TestState>(); world.SetFromToTicks(0, 1); world.Update(1f); WorldUtilities.ReleaseWorld <TestState>(ref world); }
public void OnDestroy() { if (this.world == null || this.world.isActive == false) { return; } this.DeInitializeFeatures(this.world); // Release world WorldUtilities.ReleaseWorld <TState>(ref this.world); }
public static void CreateWorld <TState>(ref World <TState> worldRef, float tickTime, int forcedWorldId = 0) where TState : class, IState <TState>, new() { if (worldRef != null) { WorldUtilities.ReleaseWorld(ref worldRef); } worldRef = PoolClass <World <TState> > .Spawn(); worldRef.SetId(forcedWorldId); ((IWorldBase)worldRef).SetTickTime(tickTime); Worlds <TState> .Register(worldRef); }
public static void CreateWorld <TState>(ref World worldRef, float tickTime, int forcedWorldId = 0, uint seed = 1u) where TState : State, new() { if (seed <= 0u) { seed = 1u; } if (worldRef != null) { WorldUtilities.ReleaseWorld <TState>(ref worldRef); } worldRef = PoolClass <World> .Spawn(); worldRef.SetId(forcedWorldId); var worldInt = worldRef; worldInt.SetSeed(seed); worldInt.SetTickTime(tickTime); Worlds.Register(worldRef); }
private void DeInitialize() { WorldUtilities.ReleaseWorld <TestState>(ref this.world); }
public void OnDestroy() { WorldUtilities.ReleaseWorld(ref this.world); }