コード例 #1
0
        public void Play(HougekiModel hougeki, int nCurrentShellingCnt, bool isNextAttack, Action onFinished)
        {
            if (hougeki == null)
            {
                this.OnShellingFinished();
            }
            this._clsHougekiModel = hougeki;
            this._isFinished      = false;
            this._isPlaying       = true;
            this._actCallback     = onFinished;
            switch (hougeki.AttackType)
            {
            case BattleAttackKind.Normal:
                if (this._clsHougekiModel.GetRocketEffenct())
                {
                    if (this._prodAntiGroundAttack == null)
                    {
                        this._prodAntiGroundAttack = new ProdAntiGroundAttack();
                    }
                    this._clsStatement.AddState(new DelProdShellingAttack(this._prodAntiGroundAttack.PlayAttack), new DelProdShellingUpdate(this._prodAntiGroundAttack.Update), new DelProdShellingClear(this._prodAntiGroundAttack.Clear));
                }
                else
                {
                    if (this._prodNormalAttack == null)
                    {
                        this._prodNormalAttack = new ProdNormalAttack();
                    }
                    this._clsStatement.AddState(new DelProdShellingAttack(this._prodNormalAttack.PlayAttack), new DelProdShellingUpdate(this._prodNormalAttack.Update), new DelProdShellingClear(this._prodNormalAttack.Clear));
                }
                break;

            case BattleAttackKind.Bakurai:
                if (this._prodDepthChargeAttack == null)
                {
                    this._prodDepthChargeAttack = new ProdDepthChargeAttack();
                }
                this._clsStatement.AddState(new DelProdShellingAttack(this._prodDepthChargeAttack.PlayAttack), new DelProdShellingUpdate(this._prodDepthChargeAttack.Update), new DelProdShellingClear(this._prodDepthChargeAttack.Clear));
                break;

            case BattleAttackKind.Gyorai:
                if (this._prodTorpedoAttack == null)
                {
                    this._prodTorpedoAttack = new ProdTorpedoAttack();
                }
                this._clsStatement.AddState(new DelProdShellingAttack(this._prodTorpedoAttack.PlayAttack), new DelProdShellingUpdate(this._prodTorpedoAttack.Update), new DelProdShellingClear(this._prodTorpedoAttack.Clear));
                break;

            case BattleAttackKind.AirAttack:
                if (this._prodAircraftAttack == null)
                {
                    this._prodAircraftAttack = new ProdAircraftAttack();
                }
                this._clsStatement.AddState(new DelProdShellingAttack(this._prodAircraftAttack.PlayAttack), new DelProdShellingUpdate(this._prodAircraftAttack.Update), new DelProdShellingClear(this._prodAircraftAttack.Clear));
                break;

            case BattleAttackKind.Laser:
                if (this._prodLaserAttack == null)
                {
                    this._prodLaserAttack = new ProdLaserAttack();
                }
                this._clsStatement.AddState(new DelProdShellingAttack(this._prodLaserAttack.PlayAttack), new DelProdShellingUpdate(this._prodLaserAttack.Update), new DelProdShellingClear(this._prodLaserAttack.Clear));
                break;

            case BattleAttackKind.Renzoku:
                if (this._prodSuccessiveAttack == null)
                {
                    this._prodSuccessiveAttack = new ProdSuccessiveAttack();
                }
                this._clsStatement.AddState(new DelProdShellingAttack(this._prodSuccessiveAttack.PlayAttack), new DelProdShellingUpdate(this._prodSuccessiveAttack.Update), new DelProdShellingClear(this._prodSuccessiveAttack.Clear));
                break;

            case BattleAttackKind.Sp1:
            case BattleAttackKind.Sp2:
            case BattleAttackKind.Sp3:
            case BattleAttackKind.Sp4:
                if (this._prodObservedShellingAttack == null)
                {
                    this._prodObservedShellingAttack = new ProdObservedShellingAttack();
                }
                this._clsStatement.AddState(new DelProdShellingAttack(this._prodObservedShellingAttack.PlayAttack), new DelProdShellingUpdate(this._prodObservedShellingAttack.Update), new DelProdShellingClear(this._prodObservedShellingAttack.Clear));
                break;

            case BattleAttackKind.Syu_Rai:
            case BattleAttackKind.Rai_Rai:
            case BattleAttackKind.Syu_Syu_Fuku:
            case BattleAttackKind.Syu_Syu_Syu:
                if (this._prodTranscendenceAttack == null)
                {
                    this._prodTranscendenceAttack = new ProdTranscendenceAttack();
                }
                this._clsStatement.AddState(new DelProdShellingAttack(this._prodTranscendenceAttack.PlayAttack), new DelProdShellingUpdate(this._prodTranscendenceAttack.Update), new DelProdShellingClear(this._prodTranscendenceAttack.Clear));
                break;
            }
            this._clsStatement.Init(this._clsHougekiModel, nCurrentShellingCnt, isNextAttack, this._dicAttackFleet.get_Item((!this.hougekiModel.Attacker.IsFriend()) ? FleetType.Enemy : FleetType.Friend), new Action(this.OnShellingFinished));
        }
コード例 #2
0
        public void Play(HougekiModel hougeki, int nCurrentShellingCnt, bool isNextAttack, Action onFinished)
        {
            if (hougeki == null)
            {
                OnShellingFinished();
            }
            _clsHougekiModel = hougeki;
            _isFinished      = false;
            _isPlaying       = true;
            _actCallback     = onFinished;
            switch (hougeki.AttackType)
            {
            case BattleAttackKind.Normal:
                if (_clsHougekiModel.GetRocketEffenct())
                {
                    if (_prodAntiGroundAttack == null)
                    {
                        _prodAntiGroundAttack = new ProdAntiGroundAttack();
                    }
                    Statement             clsStatement5         = _clsStatement;
                    ProdAntiGroundAttack  prodAntiGroundAttack  = _prodAntiGroundAttack;
                    DelProdShellingAttack initdelegate5         = prodAntiGroundAttack.PlayAttack;
                    ProdAntiGroundAttack  prodAntiGroundAttack2 = _prodAntiGroundAttack;
                    DelProdShellingUpdate updatedelegate5       = prodAntiGroundAttack2.Update;
                    ProdAntiGroundAttack  prodAntiGroundAttack3 = _prodAntiGroundAttack;
                    clsStatement5.AddState(initdelegate5, updatedelegate5, prodAntiGroundAttack3.Clear);
                }
                else
                {
                    if (_prodNormalAttack == null)
                    {
                        _prodNormalAttack = new ProdNormalAttack();
                    }
                    Statement             clsStatement6     = _clsStatement;
                    ProdNormalAttack      prodNormalAttack  = _prodNormalAttack;
                    DelProdShellingAttack initdelegate6     = prodNormalAttack.PlayAttack;
                    ProdNormalAttack      prodNormalAttack2 = _prodNormalAttack;
                    DelProdShellingUpdate updatedelegate6   = prodNormalAttack2.Update;
                    ProdNormalAttack      prodNormalAttack3 = _prodNormalAttack;
                    clsStatement6.AddState(initdelegate6, updatedelegate6, prodNormalAttack3.Clear);
                }
                break;

            case BattleAttackKind.Bakurai:
            {
                if (_prodDepthChargeAttack == null)
                {
                    _prodDepthChargeAttack = new ProdDepthChargeAttack();
                }
                Statement             clsStatement9          = _clsStatement;
                ProdDepthChargeAttack prodDepthChargeAttack  = _prodDepthChargeAttack;
                DelProdShellingAttack initdelegate9          = prodDepthChargeAttack.PlayAttack;
                ProdDepthChargeAttack prodDepthChargeAttack2 = _prodDepthChargeAttack;
                DelProdShellingUpdate updatedelegate9        = prodDepthChargeAttack2.Update;
                ProdDepthChargeAttack prodDepthChargeAttack3 = _prodDepthChargeAttack;
                clsStatement9.AddState(initdelegate9, updatedelegate9, prodDepthChargeAttack3.Clear);
                break;
            }

            case BattleAttackKind.Gyorai:
            {
                if (_prodTorpedoAttack == null)
                {
                    _prodTorpedoAttack = new ProdTorpedoAttack();
                }
                Statement             clsStatement7      = _clsStatement;
                ProdTorpedoAttack     prodTorpedoAttack  = _prodTorpedoAttack;
                DelProdShellingAttack initdelegate7      = prodTorpedoAttack.PlayAttack;
                ProdTorpedoAttack     prodTorpedoAttack2 = _prodTorpedoAttack;
                DelProdShellingUpdate updatedelegate7    = prodTorpedoAttack2.Update;
                ProdTorpedoAttack     prodTorpedoAttack3 = _prodTorpedoAttack;
                clsStatement7.AddState(initdelegate7, updatedelegate7, prodTorpedoAttack3.Clear);
                break;
            }

            case BattleAttackKind.AirAttack:
            {
                if (_prodAircraftAttack == null)
                {
                    _prodAircraftAttack = new ProdAircraftAttack();
                }
                Statement             clsStatement3       = _clsStatement;
                ProdAircraftAttack    prodAircraftAttack  = _prodAircraftAttack;
                DelProdShellingAttack initdelegate3       = prodAircraftAttack.PlayAttack;
                ProdAircraftAttack    prodAircraftAttack2 = _prodAircraftAttack;
                DelProdShellingUpdate updatedelegate3     = prodAircraftAttack2.Update;
                ProdAircraftAttack    prodAircraftAttack3 = _prodAircraftAttack;
                clsStatement3.AddState(initdelegate3, updatedelegate3, prodAircraftAttack3.Clear);
                break;
            }

            case BattleAttackKind.Laser:
            {
                if (_prodLaserAttack == null)
                {
                    _prodLaserAttack = new ProdLaserAttack();
                }
                Statement             clsStatement2    = _clsStatement;
                ProdLaserAttack       prodLaserAttack  = _prodLaserAttack;
                DelProdShellingAttack initdelegate2    = ((BaseProdAttackShelling)prodLaserAttack).PlayAttack;
                ProdLaserAttack       prodLaserAttack2 = _prodLaserAttack;
                DelProdShellingUpdate updatedelegate2  = prodLaserAttack2.Update;
                ProdLaserAttack       prodLaserAttack3 = _prodLaserAttack;
                clsStatement2.AddState(initdelegate2, updatedelegate2, prodLaserAttack3.Clear);
                break;
            }

            case BattleAttackKind.Renzoku:
            {
                if (_prodSuccessiveAttack == null)
                {
                    _prodSuccessiveAttack = new ProdSuccessiveAttack();
                }
                Statement             clsStatement8         = _clsStatement;
                ProdSuccessiveAttack  prodSuccessiveAttack  = _prodSuccessiveAttack;
                DelProdShellingAttack initdelegate8         = prodSuccessiveAttack.PlayAttack;
                ProdSuccessiveAttack  prodSuccessiveAttack2 = _prodSuccessiveAttack;
                DelProdShellingUpdate updatedelegate8       = prodSuccessiveAttack2.Update;
                ProdSuccessiveAttack  prodSuccessiveAttack3 = _prodSuccessiveAttack;
                clsStatement8.AddState(initdelegate8, updatedelegate8, prodSuccessiveAttack3.Clear);
                break;
            }

            case BattleAttackKind.Sp1:
            case BattleAttackKind.Sp2:
            case BattleAttackKind.Sp3:
            case BattleAttackKind.Sp4:
            {
                if (_prodObservedShellingAttack == null)
                {
                    _prodObservedShellingAttack = new ProdObservedShellingAttack();
                }
                Statement clsStatement4 = _clsStatement;
                ProdObservedShellingAttack prodObservedShellingAttack = _prodObservedShellingAttack;
                DelProdShellingAttack      initdelegate4 = prodObservedShellingAttack.PlayAttack;
                ProdObservedShellingAttack prodObservedShellingAttack2 = _prodObservedShellingAttack;
                DelProdShellingUpdate      updatedelegate4             = prodObservedShellingAttack2.Update;
                ProdObservedShellingAttack prodObservedShellingAttack3 = _prodObservedShellingAttack;
                clsStatement4.AddState(initdelegate4, updatedelegate4, prodObservedShellingAttack3.Clear);
                break;
            }

            case BattleAttackKind.Syu_Rai:
            case BattleAttackKind.Rai_Rai:
            case BattleAttackKind.Syu_Syu_Fuku:
            case BattleAttackKind.Syu_Syu_Syu:
            {
                if (_prodTranscendenceAttack == null)
                {
                    _prodTranscendenceAttack = new ProdTranscendenceAttack();
                }
                Statement clsStatement = _clsStatement;
                ProdTranscendenceAttack prodTranscendenceAttack  = _prodTranscendenceAttack;
                DelProdShellingAttack   initdelegate             = prodTranscendenceAttack.PlayAttack;
                ProdTranscendenceAttack prodTranscendenceAttack2 = _prodTranscendenceAttack;
                DelProdShellingUpdate   updatedelegate           = prodTranscendenceAttack2.Update;
                ProdTranscendenceAttack prodTranscendenceAttack3 = _prodTranscendenceAttack;
                clsStatement.AddState(initdelegate, updatedelegate, prodTranscendenceAttack3.Clear);
                break;
            }
            }
            _clsStatement.Init(_clsHougekiModel, nCurrentShellingCnt, isNextAttack, _dicAttackFleet[(!hougekiModel.Attacker.IsFriend()) ? FleetType.Enemy : FleetType.Friend], OnShellingFinished);
        }