public void Complete_IncompleteCondition_False() { var conditionRunner = new ActionStateConditionRunner(); var condition = new TestActionStateCondition(); conditionRunner.AddCondition(condition); Assert.IsFalse(conditionRunner.IsComplete()); }
public void Update_ConditionDoesNotComplete_CompleteFalse() { var conditionRunner = new ActionStateConditionRunner(); var condition = new TestActionStateCondition(); conditionRunner.AddCondition(condition); conditionRunner.Update(1.0f); Assert.IsFalse(conditionRunner.IsComplete()); }
public void ConditionCompletes_NeedsUpdateToBeNotified() { var conditionRunner = new ActionStateConditionRunner(); var condition = new TestActionStateCondition(); conditionRunner.AddCondition(condition); condition.ForceComplete(); Assert.IsFalse(conditionRunner.IsComplete()); }
protected override void OnUpdate(float deltaTime) { _conditionRunner.Update(deltaTime); if (_conditionRunner.IsComplete()) { if (_params.CanRespawn) { UnityMessageEventFunctions.InvokeMessageEventWithDispatcher(GameModeComponent.RegisteredGameMode.gameObject, new RequestRespawnMessage(Info.Owner)); } } }
public void Update_NeedsAllConditionsToComplete() { var conditionRunner = new ActionStateConditionRunner(); var firstCondition = new TestActionStateCondition(); var secondCondition = new TestActionStateCondition(); conditionRunner.AddCondition(firstCondition); conditionRunner.AddCondition(secondCondition); firstCondition.ForceComplete(); conditionRunner.Update(1.0f); Assert.IsFalse(conditionRunner.IsComplete()); }
public void PushNewTrack_DoesNotUpdateNewTrackUntilPriorComplete() { var conditionRunner = new ActionStateConditionRunner(); var firstCondition = new TestActionStateCondition(); var secondCondition = new TestActionStateCondition(); conditionRunner.AddCondition(firstCondition); conditionRunner.PushNewTrack(); conditionRunner.AddCondition(secondCondition); firstCondition.ForceComplete(); secondCondition.ForceComplete(); conditionRunner.Update(1.0f); Assert.IsFalse(conditionRunner.IsComplete()); }
public void PushNewTrack_UpdateAfterPriorCompletesTrack() { var conditionRunner = new ActionStateConditionRunner(); var firstCondition = new TestActionStateCondition(); var secondCondition = new TestActionStateCondition(); conditionRunner.AddCondition(firstCondition); conditionRunner.PushNewTrack(); conditionRunner.AddCondition(secondCondition); firstCondition.ForceComplete(); secondCondition.ForceComplete(); conditionRunner.Update(1.0f); conditionRunner.Update(1.0f); Assert.IsTrue(conditionRunner.IsComplete()); }
public void Complete_NoConditions_False() { var conditionRunner = new ActionStateConditionRunner(); Assert.IsFalse(conditionRunner.IsComplete()); }