/// <summary> /// Asserts that the correct exception was notified. /// </summary> /// <param name="expectedStateId">The expected state id.</param> /// <param name="expectedEventId">The expected event id.</param> /// <param name="expectedEventArguments">The expected event arguments.</param> /// <param name="expectedException">The expected exception.</param> private void AssertException(StateMachine.States expectedStateId, StateMachine.Events expectedEventId, object[] expectedEventArguments, Exception expectedException) { Assert.Equal(expectedStateId, this.recordedStateId); Assert.Equal(expectedEventId, this.recordedEventId); Assert.Equal(expectedEventArguments, this.recordedEventArgument); Assert.Equal(expectedException, this.recordedException); }
/// <summary> /// Asserts that the correct exception was notified. /// </summary> /// <param name="expectedStateId">The expected state id.</param> /// <param name="expectedEventId">The expected event id.</param> /// <param name="expectedEventArguments">The expected event arguments.</param> /// <param name="expectedException">The expected exception.</param> private void AssertException(StateMachine.States expectedStateId, StateMachine.Events expectedEventId, object[] expectedEventArguments, Exception expectedException) { this.recordedStateId.Should().Be(expectedStateId); this.recordedEventId.Should().Be(expectedEventId); this.recordedEventArgument.Should().Be(expectedEventArguments); this.recordedException.Should().Be(expectedException); }
protected override void Init() { base.Init(); canTransitionInto = new StateMachine.States[] { StateMachine.States.Harvesting }; }
/// <summary> /// Checks that the first record in the list of records is of type <typeparamref name="T"/> and involves the specified state. /// The record is removed after the check. /// </summary> /// <typeparam name="T">Type of the record.</typeparam> /// <param name="state">The state.</param> private void CheckRecord <T>(StateMachine.States state) { Record record = this.records.FirstOrDefault(); Assert.NotNull(record); Assert.True(record.GetType() == typeof(T) && record.State == state, record.Message); this.records.RemoveAt(0); }
/// <summary> /// Checks that the first record in the list of records is of type <typeparamref name="T"/> and involves the specified state. /// The record is removed after the check. /// </summary> /// <typeparam name="T">Type of the record.</typeparam> /// <param name="state">The state.</param> private void CheckRecord <T>(StateMachine.States state) where T : Record { Record record = this.records.FirstOrDefault(); record.Should().NotBeNull(); record.Should().BeAssignableTo <T>(); // ReSharper disable once PossibleNullReferenceException record.State.Should().Be(state, record.Message); this.records.RemoveAt(0); }
protected override void Init() { base.Init(); canTransitionInto = new StateMachine.States[] { StateMachine.States.Idle, StateMachine.States.Incapacitated, StateMachine.States.FightOrFlight, StateMachine.States.Dead }; }
protected override void Init() { canTransitionInto = new StateMachine.States[] { StateMachine.States.Idle, StateMachine.States.Incapacitated, StateMachine.States.FightOrFlight, StateMachine.States.Dead }; npc = (NPCStateMachine)stateMachine; }
/// <summary> /// Records the exit out of a state. /// </summary> /// <param name="state">The state.</param> private void RecordExit(StateMachine.States state) { this.records.Add(new ExitRecord { State = state }); }
/// <summary> /// Records the entry into a state /// </summary> /// <param name="state">The state.</param> private void RecordEntry(StateMachine.States state) { this.records.Add(new EntryRecord { State = state }); }
public Focus(int layerMask, StateMachine.States state, Camera camera, float delaySeconds, float mouseSpeedThreshold) : base(layerMask, state, camera) { DelaySeconds = delaySeconds; needCheckSpeed = !mouseSpeedThreshold.Equals(-1f); MouseSpeedThreshold = mouseSpeedThreshold; }
public PressHoverImmediately(int layerMask, StateMachine.States state, Camera camera) : base(layerMask, state, camera) { }
protected HoverActionBase(int layerMask, StateMachine.States state, Camera camera) { State = state; LayerMask = layerMask; Camera = camera; }