/// <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);
 }
Esempio n. 2
0
 /// <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);
 }
Esempio n. 3
0
 protected override void Init()
 {
     base.Init();
     canTransitionInto = new StateMachine.States[]
     {
         StateMachine.States.Harvesting
     };
 }
Esempio n. 4
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)
        {
            Record record = this.records.FirstOrDefault();

            Assert.NotNull(record);
            Assert.True(record.GetType() == typeof(T) && record.State == state, record.Message);

            this.records.RemoveAt(0);
        }
Esempio n. 5
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);
        }
Esempio n. 6
0
 protected override void Init()
 {
     base.Init();
     canTransitionInto = new StateMachine.States[]
     {
         StateMachine.States.Idle,
         StateMachine.States.Incapacitated,
         StateMachine.States.FightOrFlight,
         StateMachine.States.Dead
     };
 }
Esempio n. 7
0
 protected override void Init()
 {
     canTransitionInto = new StateMachine.States[]
     {
         StateMachine.States.Idle,
         StateMachine.States.Incapacitated,
         StateMachine.States.FightOrFlight,
         StateMachine.States.Dead
     };
     npc = (NPCStateMachine)stateMachine;
 }
Esempio n. 8
0
 /// <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
     });
 }
Esempio n. 9
0
 /// <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;
 }