コード例 #1
0
        public IWeaponFireController GetFireController(WeaponAllConfigs configs,
                                                       DefaultWeaponAbstractFireFireLogicConfig config)
        {
            IWeaponFireController v = null;

            if (_cache.TryGetValue(configs.S_Id, out v))
            {
                return(_cache[configs.S_Id]);
            }

            var defaultCfg = config as DefaultFireLogicConfig;

            if (null != defaultCfg)
            {
                v = CreateCommonFireController(configs, defaultCfg);
                _cache[configs.S_Id] = v;
                return(v);
            }

            var meleeCfg = config as MeleeFireLogicConfig;

            if (null != meleeCfg)
            {
                v = new MeleeWeaponFireController(meleeCfg);
                _cache[configs.S_Id] = v;
                return(v);
            }

            var throwingCfg = config as ThrowingFireLogicConfig;

            if (null != throwingCfg)
            {
                v = new ThrowingWeaponFireController(throwingCfg, configs.NewWeaponCfg);
                _cache[configs.S_Id] = v;
                return(v);
            }

            if (configs.NewWeaponCfg.Type != (int)EWeaponType_Config.TacticWeapon)
            {
                Logger.ErrorFormat("no firelogic for weapon {0}", configs.S_Id);
            }

            return(null);
        }
コード例 #2
0
 public CommonWeaponFireUpdate(IWeaponFireController controller)
 {
     fireController = controller;
 }
コード例 #3
0
 public void SetController(IWeaponFireController controller)
 {
     fireController = controller;
 }
コード例 #4
0
 public DoubleWeaponFireUpdate(IWeaponFireController leftWeaponFire, IWeaponFireController rightWeaponFire)
 {
     _leftWeaponFire  = leftWeaponFire;
     _rightWeaponFire = rightWeaponFire;
 }
コード例 #5
0
 public CommonWeaponFireUpdate(IWeaponFireController controller)
 {
     SetController(controller);
 }