Ejemplo n.º 1
0
        public void Update_CharacterDead_ReturnsCompleted()
        {
            _actionStateMachine.IsActionStateActiveResult = true;
            var goal = new AttackTargetGoal(_attack.gameObject, _actionStateMachine.gameObject);

            Assert.AreEqual(EGoalStatus.Completed, goal.Update(1.9f));
        }
Ejemplo n.º 2
0
        public void Update_CanAttack_InProgress()
        {
            _attack.CanAttackResult = true;
            var goal = new AttackTargetGoal(_attack.gameObject, _actionStateMachine.gameObject);

            Assert.AreEqual(EGoalStatus.InProgress, goal.Update(1.9f));
        }
Ejemplo n.º 3
0
        public void Update_CanAttack_Attacks()
        {
            _attack.CanAttackResult = true;
            var goal = new AttackTargetGoal(_attack.gameObject, _actionStateMachine.gameObject);

            goal.Update(1.0f);

            Assert.IsTrue(_attack.AttackCalled);
        }
Ejemplo n.º 4
0
        public void Update_CannotAttack_DoesNotAttack()
        {
            _attack.CanAttackResult = false;
            var goal = new AttackTargetGoal(_attack.gameObject, _actionStateMachine.gameObject);

            goal.Update(1.0f);

            Assert.IsFalse(_attack.AttackCalled);
        }
Ejemplo n.º 5
0
        public void Update_QueriesIfCharacterDead()
        {
            var goal = new AttackTargetGoal(_attack.gameObject, _actionStateMachine.gameObject);

            goal.Update(1.0f);

            Assert.AreEqual(EActionStateMachineTrack.Locomotion, _actionStateMachine.IsActionStateActiveTrackQuery);
            Assert.AreEqual(EActionStateId.Dead, _actionStateMachine.IsActionStateActiveIdQuery);
        }
Ejemplo n.º 6
0
        public void Update_NoActionStateMachine_Fails()
        {
            var goal = new AttackTargetGoal(_attack.gameObject, new GameObject());

            Assert.AreEqual(EGoalStatus.Failed, goal.Update(1.9f));
        }
Ejemplo n.º 7
0
        public void Update_NoAttackInterface_Fails()
        {
            var goal = new AttackTargetGoal(new GameObject(), _actionStateMachine.gameObject);

            Assert.AreEqual(EGoalStatus.Failed, goal.Update(1.9f));
        }
Ejemplo n.º 8
0
        public void Update_NoTarget_Fails()
        {
            var goal = new AttackTargetGoal(_attack.gameObject, null);

            Assert.AreEqual(EGoalStatus.Failed, goal.Update(1.9f));
        }
Ejemplo n.º 9
0
        public void Update_NoOwner_Fails()
        {
            var goal = new AttackTargetGoal(null, _actionStateMachine.gameObject);

            Assert.AreEqual(EGoalStatus.Failed, goal.Update(1.9f));
        }