private void ProcessSpread(DefaultFireLogicConfig defaultFireLogicConfig) { var spreadConfig = defaultFireLogicConfig.SpreadLogic; S_RifleSpreadLogicCfg = spreadConfig as RifleSpreadLogicConfig; if (null != S_RifleSpreadLogicCfg) { return; } S_FixedSpreadLogicCfg = spreadConfig as FixedSpreadLogicConfig; if (null != S_FixedSpreadLogicCfg) { return; } S_PistolSpreadLogicCfg = spreadConfig as PistolSpreadLogicConfig; if (null != S_PistolSpreadLogicCfg) { return; } S_SniperSpreadLogicCfg = spreadConfig as SniperSpreadLogicConfig; if (null != S_SniperSpreadLogicCfg) { return; } }
private void ProcessFireMode(DefaultFireLogicConfig defaultFireLogicConfig) { S_DefaultFireModeLogicCfg = defaultFireLogicConfig.FireModeLogic as DefaultFireModeLogicConfig; if (null != S_DefaultFireModeLogicCfg) { return; } }
private void ProcessShake(DefaultFireLogicConfig defaultFireLogicConfig) { var kickbackConfig = defaultFireLogicConfig.Shake; SRifleShakeCfg = kickbackConfig as RifleShakeConfig; if (null != SRifleShakeCfg) { return; } SFixedShakeCfg = kickbackConfig as FixedShakeConfig; if (null != SFixedShakeCfg) { return; } }
private void ProcessAccuracy(DefaultFireLogicConfig defaultFireLogicConfig) { var accuracyConfig = defaultFireLogicConfig.AccuracyLogic; S_BaseAccuracyLogicCfg = accuracyConfig as BaseAccuracyLogicConfig; if (null != S_BaseAccuracyLogicCfg) { return; } S_PistolAccuracyLogicCfg = accuracyConfig as PistolAccuracyLogicConfig; if (null != S_PistolAccuracyLogicCfg) { return; } }
private IFireLogic CreateDefaultFireLogic(NewWeaponConfigItem newWeaponConfig, DefaultFireLogicConfig config) { var fireLogic = new DefaultFireLogic(); fireLogic.RegisterLogic(_componentsFactory.CreateAccuracyLogic(config.AccuracyLogic)); fireLogic.RegisterLogic(_componentsFactory.CreateSpreadLogic(config.SpreadLogic)); fireLogic.RegisterLogic(_componentsFactory.CreateKickbackLogic(config.KickbackLogic)); fireLogic.RegisterLogic(_componentsFactory.CreateFireCheckLogic(config.FireModeLogic)); fireLogic.RegisterLogic(_componentsFactory.CreateFireActionLogic(newWeaponConfig)); fireLogic.RegisterLogic(_componentsFactory.CreateFireBulletCounterLogic(config.FireCounter)); fireLogic.RegisterLogic(_componentsFactory.CreateAutoFireLogic(config.FireModeLogic)); fireLogic.RegisterLogic(_componentsFactory.CreateBulletFireLogic(config.Bullet)); fireLogic.RegisterLogic(_componentsFactory.CreateSpecialReloadCheckLogic(config.Basic)); fireLogic.RegisterLogic(_componentsFactory.CreateFireCommandLogic(config)); fireLogic.RegisterLogic(_componentsFactory.CreateShowFireInMap(config)); return(fireLogic); }
private IWeaponFireController CreateCommonFireController(WeaponAllConfigs allConfigs, DefaultFireLogicConfig config) { var fireLogic = new CommonWeaponFireController(); fireLogic.RegisterProcessor(_scriptUtil.CreateAccuracyCalculator(config.AccuracyLogic)); fireLogic.RegisterProcessor(_scriptUtil.CreateSpreadProcessor(config.SpreadLogic)); fireLogic.RegisterProcessor(_scriptUtil.CreateShakeProcessor(config.Shake)); fireLogic.RegisterProcessor(_scriptUtil.CreateEffectManager(allConfigs.S_EffectConfig)); fireLogic.RegisterProcessor(_scriptUtil.CreateFireModeChecker(allConfigs)); fireLogic.RegisterProcessor(_scriptUtil.CreateFireModeUpdater(config.FireModeLogic)); fireLogic.RegisterProcessor(_scriptUtil.CreateFireActionLogic(allConfigs)); fireLogic.RegisterProcessor(_scriptUtil.CreateFireBulletCounter(config.FireCounter)); fireLogic.RegisterProcessor(_scriptUtil.CreateAutoFireProcessor(config.FireModeLogic)); fireLogic.RegisterProcessor(_scriptUtil.CreateBulletFireListener(config.Bullet)); fireLogic.RegisterProcessor(_scriptUtil.CreateSpecialReloadChecker(config.Basic)); fireLogic.RegisterProcessor(_scriptUtil.CreateFireTrigger(config)); fireLogic.RegisterProcessor(_scriptUtil.CreateShowFireInMap(config)); return(fireLogic); }