Example #1
0
        private void MakeFSM()
        {
            mFSMSystem = new EnemyFSMSystem();

            EnemyChaseState chaseState = new EnemyChaseState(mFSMSystem, this);

            chaseState.AddTransition(EnemyTransition.CanAttack, EnemyStateID.Attack);

            EnemyAttackState attackState = new EnemyAttackState(mFSMSystem, this);

            attackState.AddTransition(EnemyTransition.LostSoldier, EnemyStateID.Chase);

            mFSMSystem.AddState(chaseState, attackState);
        }
 public EnemyAttackState(EnemyFSMSystem fsm, ICharacter c) : base(fsm, c)
 {
     mStateID     = EnemyStateID.Attack;
     mAttackTimer = mAttackTime;
 }
 public EnemyChaseState(EnemyFSMSystem fsm, ICharacter c) : base(fsm, c)
 {
     mStateID = EnemyStateID.Chase;
 }
Example #4
0
 public IEnemyState(EnemyFSMSystem fsm, ICharacter character)
 {
     mFSM       = fsm;
     mCharacter = character;
 }