Esempio n. 1
0
        public WeaponStateMachine(WeaponStateContext context)
        {
            _context = context;

            _states = new Dictionary <WeaponState, BaseWeaponState>
            {
                { WeaponState.Inactive, new InactiveWeaponState(context) },
                { WeaponState.InactivePendingReload, new InactivePendingReloadWeaponState(context) },
                { WeaponState.PreAttack, new PreAttackWeaponState(context) },
                { WeaponState.Firing, new FiringWeaponState(context) },
                { WeaponState.IdleAfterFiring, new IdleAfterFiringWeaponState(context) },
                { WeaponState.BetweenShots, new BetweenShotsWeaponState(context) },
                { WeaponState.Reloading, new ReloadingWeaponState(context) }
            };

            TransitionToState(WeaponState.Inactive, TimeSpan.Zero);
        }
Esempio n. 2
0
 public PreAttackWeaponState(WeaponStateContext context)
     : base(context)
 {
 }
Esempio n. 3
0
 public FiringWeaponState(WeaponStateContext context)
     : base(context)
 {
 }
Esempio n. 4
0
 public InactiveWeaponState(WeaponStateContext context)
     : base(context)
 {
 }
 public IdleAfterFiringWeaponState(WeaponStateContext context)
     : base(context)
 {
 }
Esempio n. 6
0
 public InactivePendingReloadWeaponState(WeaponStateContext context)
     : base(context)
 {
 }
Esempio n. 7
0
 protected BaseWeaponState(WeaponStateContext context)
 {
     Context             = context;
     ModelConditionFlags = GetModelConditionFlags(context.Weapon.WeaponIndex);
 }
Esempio n. 8
0
 public ReloadingWeaponState(WeaponStateContext context)
     : base(context)
 {
 }
Esempio n. 9
0
 public BetweenShotsWeaponState(WeaponStateContext context)
     : base(context)
 {
 }
Esempio n. 10
0
 protected FixedDurationWeaponState(WeaponStateContext context)
     : base(context)
 {
 }