public void SetUp() { KeyDomainUtility.Initialize(new World("TestWorld")); m_StateManager = KeyDomainUtility.StateManager; m_Scheduler = new KeyDomainScheduler(); m_Scheduler.Initialize(m_StateManager); }
public void ExecuteCompletePlanTriggersCallbackAtTerminalState() { // Force terminal evaluation. m_Scheduler.Dispose(); m_Scheduler = new KeyDomainScheduler(); m_Scheduler.Initialize(m_StateManager, terminationEvaluator: new TestManualOverrideTerminationEvaluator <StateData> { TerminationReturnValue = true }); // Initiate query var query = m_Scheduler.RequestPlan(KeyDomainUtility.InitialStateKey).PlanUntil(maximumUpdates: 1); // Schedule single iteration m_Scheduler.Schedule(default);
public void SetUp() { var world = new World("TestWorld"); m_StateManager = world.GetOrCreateSystem <StateManager>(); world.GetOrCreateSystem <SimulationSystemGroup>().AddSystemToUpdateList(m_StateManager); KeyDomainUtility.Initialize(world); m_Actor = new GameObject("TestGameObject").AddComponent <MockMonoBehaviour>(); m_Executor = new MockKeyDomainPlanExecutor(m_StateManager); m_Executor.SetExecutionSettings(m_Actor, null, default); m_Scheduler = new KeyDomainScheduler(); m_Scheduler.Initialize(m_StateManager); }
public void CallbackInvokedAndQueryStatusIsCompleteAfterPlanComplete() { // Force terminal evaluation. m_Scheduler.Dispose(); m_Scheduler = new KeyDomainScheduler(); m_Scheduler.Initialize(m_StateManager, terminationEvaluator: new TestManualOverrideTerminationEvaluator <StateData> { TerminationReturnValue = true }); bool complete = false; var query = m_Scheduler.RequestPlan(KeyDomainUtility.InitialStateKey, plan => { complete = true; }); for (int i = 0; i < 3 && !complete; i++) { m_Scheduler.Schedule(default);