Example #1
0
        private bool isValidSetDeck(RebellionFleetType iType, DeckModel model)
        {
            DebugUtils.Log("isValidSetDeck::" + iType);
            bool                 flag             = !_uiParticipatingFleetSelector.IsAlreadySetFleet(_uiFleetSelector.nowSelectedDeck) && _uiFleetSelector.nowSelectedDeck.GetFlagShip() != null;
            RebellionManager     rebellionManager = StrategyTaskManager.GetStrategyRebellion().GetRebellionManager();
            bool                 flag2            = false;
            List <IsGoCondition> list             = null;

            switch (iType)
            {
            case RebellionFleetType.VanguardSupportFleet:
                list = rebellionManager.IsValidMissionSub(model.Id);
                break;

            case RebellionFleetType.DecisiveBattleSupportFleet:
                list = rebellionManager.IsValid_MissionMain(model.Id);
                break;
            }
            if (list == null || list.Count == 0)
            {
                flag2 = true;
            }
            else
            {
                CommonPopupDialog.Instance.StartPopup(Util.getCancelReason(list[0]));
            }
            return(flag && flag2);
        }
Example #2
0
        public bool Init()
        {
            SortPanelDepth(_nBaseDepth);
            _uiParticipatingFleetSelector.Init(DecideParticipatingFleetInfo, DecideSortieStart);
            RebellionManager rebellionManager = StrategyTaskManager.GetStrategyRebellion().GetRebellionManager();
            List <DeckModel> list             = new List <DeckModel>();

            for (int i = 0; i < rebellionManager.Decks.Count; i++)
            {
                if (rebellionManager.Decks[i].IsValidSortie().Count == 0)
                {
                    list.Add(rebellionManager.Decks[i]);
                }
            }
            _uiFleetSelector.Init(list, 0, DecideFleetSelector);
            _uiFleetSelector.rouletteSelector.controllable = false;
            KeyControl keycontrol = StrategyTaskManager.GetStrategyRebellion().keycontrol;

            keycontrol.reset();
            keycontrol.setMinMaxIndex(0, Enum.GetValues(typeof(RebellionFleetType)).Length);
            keycontrol.useDoubleIndex(0, _uiFleetSelector.fleetCnt - 1);
            base.transform.localScaleOne();
            Show();
            return(true);
        }
Example #3
0
        private void DecideSortieStart()
        {
            DebugUtils.Log("TaskRebellionOrganize", string.Empty);
            RebellionManager rebellionManager = StrategyTaskManager.GetStrategyRebellion().GetRebellionManager();
            List <UIRebellionParticipatingFleetInfo> participatingFleetList             = _ctrlRebellionOrganize.participatingFleetSelector.participatingFleetList;
            UIRebellionParticipatingFleetInfo        uIRebellionParticipatingFleetInfo  = participatingFleetList.Find((UIRebellionParticipatingFleetInfo x) => x.type == RebellionFleetType.VanguardFleet);
            UIRebellionParticipatingFleetInfo        uIRebellionParticipatingFleetInfo2 = participatingFleetList.Find((UIRebellionParticipatingFleetInfo x) => x.type == RebellionFleetType.DecisiveBattlePrimaryFleet);
            UIRebellionParticipatingFleetInfo        uIRebellionParticipatingFleetInfo3 = participatingFleetList.Find((UIRebellionParticipatingFleetInfo x) => x.type == RebellionFleetType.VanguardSupportFleet);
            UIRebellionParticipatingFleetInfo        uIRebellionParticipatingFleetInfo4 = participatingFleetList.Find((UIRebellionParticipatingFleetInfo x) => x.type == RebellionFleetType.DecisiveBattleSupportFleet);

            int[] array = new int[4]
            {
                (!(uIRebellionParticipatingFleetInfo == null)) ? uIRebellionParticipatingFleetInfo.deckModel.Id : (-1),
                (!(uIRebellionParticipatingFleetInfo2 == null)) ? uIRebellionParticipatingFleetInfo2.deckModel.Id : (-1),
                (!(uIRebellionParticipatingFleetInfo3 == null)) ? uIRebellionParticipatingFleetInfo3.deckModel.Id : (-1),
                (!(uIRebellionParticipatingFleetInfo4 == null)) ? uIRebellionParticipatingFleetInfo4.deckModel.Id : (-1)
            };
            bool flag = rebellionManager.IsGoRebellion(array[0], array[1], array[2], array[3]);
            List <IsGoCondition> list  = null;
            List <IsGoCondition> list2 = null;

            if (array[2] != -1)
            {
                list = rebellionManager.IsValidMissionSub(array[2]);
            }
            if (array[3] != -1)
            {
                list2 = rebellionManager.IsValid_MissionMain(array[3]);
            }
            bool flag2 = list == null || (list != null && list.Count == 0);
            bool flag3 = list2 == null || (list2 != null && list2.Count == 0);

            if (flag && flag2 && flag3)
            {
                RebellionMapManager rebellionMapManager = rebellionManager.GoRebellion(array[0], array[1], array[2], array[3]);
                MapModel            map       = rebellionMapManager.Map;
                Hashtable           hashtable = new Hashtable();
                hashtable.Add("rebellionMapManager", rebellionMapManager);
                hashtable.Add("rootType", 0);
                hashtable.Add("shipRecoveryType", ShipRecoveryType.None);
                hashtable.Add("escape", false);
                RetentionData.SetData(hashtable);
                Object.Destroy(SingletonMonoBehaviour <PortObjectManager> .Instance.gameObject);
                SingletonMonoBehaviour <AppInformation> .Instance.prevStrategyDecks = StrategyTopTaskManager.GetLogicManager().UserInfo.GetDecks();
                StartCoroutine(PlayTransition(map, uIRebellionParticipatingFleetInfo2.deckModel));
            }
            SoundUtils.PlaySE(SEFIleInfos.CommonEnter1);
        }
Example #4
0
        protected override bool Init()
        {
            SingletonMonoBehaviour <UIShortCutMenu> .Instance.IsInputEnable = false;
            int rebellionArea = RebellionArea;

            _clsRebellionManager = StrategyTopTaskManager.GetLogicManager().SelectAreaForRebellion(rebellionArea);
            _clsInput            = new KeyControl();
            _clsTasks            = this.SafeGetComponent <SceneTasksMono>();
            _clsTasks.Init();
            _iMode = (_iModeReq = StrategyRebellionTaskManagerMode.StrategyRebellionTaskManager_BEF);
            Observable.FromCoroutine((IObserver <bool> observer) => CreateRequireInstante(observer)).Subscribe(delegate(bool x)
            {
                if (x)
                {
                    _iMode = (_iModeReq = StrategyRebellionTaskManagerMode.StrategyRebellionTaskManager_ST);
                }
            }).AddTo(base.gameObject);
            return(true);
        }
 void Start()
 {
     animator    = GetComponent <Animator>();
     m_rebellion = GetComponent <RebellionManager>();
     UpdateAll();
 }
        private IEnumerator OneDeckGoSortie()
        {
            RebellionManager mng         = StrategyTaskManager.GetStrategyRebellion().GetRebellionManager();
            List <DeckModel> enableDecks = deckInfoManager.GetSortieEnableDeck(AreaDecks);

            if (enableDecks.Count != 1)
            {
            }
            DeckModel deck = enableDecks[0];

            if (mng.IsGoRebellion(-1, deck.Id, -1, -1))
            {
                StartCoroutine(OpenConfirmDialog(deck));
                GoSortieConfirm.Initialize(deck, isConfirm: true);
                GoSortieConfirm.SetPushYesButton(delegate
                {
                    this.StrategyDialog.CloseDialog();
                    this.StrategyDialog.setCloseAction(delegate
                    {
                        RebellionMapManager rebellionMapManager = mng.GoRebellion(-1, deck.Id, -1, -1);
                        MapModel map = rebellionMapManager.Map;
                        RetentionData.SetData(new Hashtable
                        {
                            {
                                "rebellionMapManager",
                                rebellionMapManager
                            },
                            {
                                "rootType",
                                0
                            },
                            {
                                "shipRecoveryType",
                                ShipRecoveryType.None
                            },
                            {
                                "escape",
                                false
                            }
                        });
                        Object.Destroy(SingletonMonoBehaviour <PortObjectManager> .Instance.gameObject);
                        this.StartCoroutine(this.PlayTransition(map, deck));
                    });
                });
                GoSortieConfirm.SetPushNoButton(delegate
                {
                    this.StrategyDialog.CloseDialog();
                    this.StrategyDialog.setCloseAction(delegate
                    {
                        this.StartCoroutine(this.NonDeckLose());
                    });
                });
            }
            else
            {
                if (AreaDecks.Count != 1)
                {
                    SingletonMonoBehaviour <AppInformation> .Instance.SlogDraw = true;
                }
                StartCoroutine(NonDeckLose());
            }
            yield return(null);
        }