public List <ShipModel> GetAreaShips(int area_id, bool use_deck, bool use_edeck, List <ShipModel> all_ships)
        {
            List <ShipModel> list         = new List <ShipModel>();
            MapAreaModel     mapAreaModel = ManagerBase._area.get_Item(area_id);

            if (use_deck)
            {
                DeckModel[] decks = mapAreaModel.GetDecks();
                DeckModel[] array = decks;
                for (int i = 0; i < array.Length; i++)
                {
                    DeckModel deckModel = array[i];
                    list.AddRange(deckModel.GetShips());
                }
            }
            if (use_edeck)
            {
                list.AddRange(mapAreaModel.GetEscortDeck().GetShips());
            }
            HashSet <int> hashSet = mapAreaModel.__GetRepairingShipMemIdsHash__();

            using (HashSet <int> .Enumerator enumerator = hashSet.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    int       current = enumerator.get_Current();
                    ShipModel ship2   = this.UserInfo.GetShip(current);
                    if (ship2.IsInDeck() == -1 && ship2.IsInEscortDeck() == -1)
                    {
                        list.Add(ship2);
                    }
                }
            }
            if (all_ships == null)
            {
                all_ships = this.UserInfo.__GetShipList__();
            }
            List <ShipModel> list2 = all_ships.FindAll((ShipModel ship) => ship.IsBlingWait() && ship.AreaIdBeforeBlingWait == area_id);

            list.AddRange(list2);
            return(list);
        }
예제 #2
0
        public void pushMenuButton()
        {
            if (isChangeingDeck || StrategyTopTaskManager.Instance.UIModel.MapCamera.isMoving)
            {
                return;
            }
            if (!StrategyTopTaskManager.GetCommandMenu().isRun)
            {
                Debug.Log("Not CommandMenuMode return");
                return;
            }
            if (!CommandMenu.isOpen)
            {
                Debug.Log("Not CommandMenu Open return");
                return;
            }
            int  num = areaModel.GetDecks().Length;
            bool flag;

            if (isMenuActive((MENU_NAME)keyController.Index))
            {
                Debug.Log("PUSH");
                flag = pushCommandMenuList[keyController.Index]();
                CommandMenu.menuParts[keyController.Index].setColider(isEnable: false);
            }
            else
            {
                flag = false;
            }
            if (flag)
            {
                SoundUtils.PlayOneShotSE(SEFIleInfos.CommonEnter1);
            }
            else
            {
                SoundUtils.PlayOneShotSE(SEFIleInfos.CommonCancel2);
            }
        }
예제 #3
0
        public List <ShipModel> GetAreaShips(int area_id, bool use_deck, bool use_edeck, List <ShipModel> all_ships)
        {
            List <ShipModel> list         = new List <ShipModel>();
            MapAreaModel     mapAreaModel = _area[area_id];

            if (use_deck)
            {
                DeckModel[] decks = mapAreaModel.GetDecks();
                DeckModel[] array = decks;
                foreach (DeckModel deckModel in array)
                {
                    list.AddRange(deckModel.GetShips());
                }
            }
            if (use_edeck)
            {
                list.AddRange(mapAreaModel.GetEscortDeck().GetShips());
            }
            HashSet <int> hashSet = mapAreaModel.__GetRepairingShipMemIdsHash__();

            foreach (int item in hashSet)
            {
                ShipModel ship2 = UserInfo.GetShip(item);
                if (ship2.IsInDeck() == -1 && ship2.IsInEscortDeck() == -1)
                {
                    list.Add(ship2);
                }
            }
            if (all_ships == null)
            {
                all_ships = UserInfo.__GetShipList__();
            }
            List <ShipModel> collection = all_ships.FindAll((ShipModel ship) => ship.IsBlingWait() && ship.AreaIdBeforeBlingWait == area_id);

            list.AddRange(collection);
            return(list);
        }
예제 #4
0
        public void map_status()
        {
            uiStageCovers = GameObject.Find("board2nd/board1/page1/UIStageCovers").GetComponentsInChildren <UIStageCover>();
            MapAreaModel areaModel = StrategyTopTaskManager.Instance.TileManager.FocusTile.GetAreaModel();

            MapModel[] maps      = StrategyTopTaskManager.GetLogicManager().SelectArea(areaModel.Id).Maps;
            UILabel    component = GameObject.Find("board2nd/board1/page1/Labels/Label_0-1").GetComponent <UILabel>();

            component.text = Util.getDifficultyString(strategyLogicManager.UserInfo.Difficulty);
            UILabel component2 = GameObject.Find("board2nd/board1/page1/Labels/Label_1-2").GetComponent <UILabel>();

            component2.text = areaModel.Name;
            UILabel component3 = GameObject.Find("board2nd/board1/page2/Labels/Label_2-4").GetComponent <UILabel>();

            component3.supportEncoding = false;
            if (areaModel.Id < 15)
            {
                string name = areaModel.GetEscortDeck().Name;
                if (name.Replace(" ", string.Empty).Replace("\u3000", string.Empty).Length != 0)
                {
                    component3.text = name;
                }
                else
                {
                    component3.text = areaModel.Name.Replace("海域", string.Empty) + "航路護衛隊";
                }
            }
            else
            {
                component3.text = "---";
            }
            GameObject.Find("board2nd/board1/page2/Decks").transform.localPosition = new Vector3(-17.536f * (float)strategyLogicManager.UserInfo.DeckCount + 94.286f, 0f);
            for (int i = 0; i < 8; i++)
            {
                UISprite component4 = GameObject.Find("board2nd/board1/page2/Decks/Deck" + (i + 1).ToString()).GetComponent <UISprite>();
                component4.color = Color.black;
                if (i < strategyLogicManager.UserInfo.DeckCount)
                {
                    component4.transform.localScale = Vector3.one;
                }
                else
                {
                    component4.transform.localScale = Vector3.zero;
                }
            }
            for (int j = 0; j < areaModel.GetDecks().Length; j++)
            {
                UISprite component4 = GameObject.Find("board2nd/board1/page2/Decks/Deck" + areaModel.GetDecks()[j].Id).GetComponent <UISprite>();
                if (areaModel.GetDecks()[j].GetShipCount() != 0)
                {
                    if (areaModel.GetDecks()[j].IsActionEnd())
                    {
                        component4.color = _Color_dock * 0.75f;
                    }
                    else if (areaModel.GetDecks()[j].MissionState != 0)
                    {
                        component4.color = Color.blue;
                    }
                    else
                    {
                        component4.color = _Color_dock;
                    }
                }
            }
            if (maps.Length < 5)
            {
                UILabel component5 = GameObject.Find("board2nd/board1/page1/Labels/Label_1-2").GetComponent <UILabel>();
                component5.transform.localPosition = new Vector3(160f, 160f, 0f);
                component5.fontSize = 36;
                UILabel component6 = GameObject.Find("board2nd/board1/page1/Labels/Label_1-1").GetComponent <UILabel>();
                component6.transform.localPosition = new Vector3(160f, 105f, 0f);
                component6.fontSize = 32;
                UILabel component7 = GameObject.Find("board2nd/board1/page1/Labels/Label_0-0").GetComponent <UILabel>();
                component7.transform.localPosition = new Vector3(329f, 105f, 0f);
                component7.fontSize = 20;
                UILabel component8 = GameObject.Find("board2nd/board1/page1/Labels/Label_0-1").GetComponent <UILabel>();
                component8.transform.localPosition = new Vector3(413f, 105f, 0f);
                component8.fontSize = 20;
                UITexture component9 = GameObject.Find("board2nd/board1/page1/lines/line_1").GetComponent <UITexture>();
                if (component9 != null)
                {
                    component9.transform.localPosition = new Vector3(160f, 103f, 0f);
                    component9.width  = 556;
                    component9.height = 2;
                }
                for (int k = 0; k < 3; k++)
                {
                    for (int l = 0; l < 2; l++)
                    {
                        int        num        = k * 2 + l + 1;
                        GameObject gameObject = GameObject.Find("board2nd/board1/page1/UIStageCovers/UIStageCover" + num.ToString());
                        if (gameObject == null)
                        {
                            break;
                        }
                        gameObject.transform.localScale = Vector3.one * 0.6f;
                        if (num < 5)
                        {
                            gameObject.transform.localPosition = new Vector3(18f + 293f * (float)l, -17f - 158f * (float)k, 0f);
                        }
                        else
                        {
                            gameObject.transform.localPosition = new Vector3(18f + 293f * (float)l, 320f, 0f);
                        }
                    }
                }
                if (maps.Length == 3)
                {
                    GameObject gameObject2 = GameObject.Find("board2nd/board1/page1/UIStageCovers/UIStageCover4");
                    gameObject2.transform.localScale = Vector3.zero;
                    GameObject gameObject3 = GameObject.Find("board2nd/board1/page1/UIStageCovers/UIStageCover3");
                    gameObject3.transform.localPosition = new Vector3(160f, -175f);
                }
                else if (maps.Length == 4)
                {
                    GameObject gameObject4 = GameObject.Find("board2nd/board1/page1/UIStageCovers/UIStageCover4");
                    gameObject4.transform.localScale = Vector3.one * 0.6f;
                    GameObject gameObject5 = GameObject.Find("board2nd/board1/page1/UIStageCovers/UIStageCover3");
                    gameObject5.transform.localPosition = new Vector3(18f, -175f);
                }
            }
            else
            {
                component2.transform.localPosition = new Vector3(160f, 171f, 0f);
                component2.fontSize = 28;
                UILabel component10 = GameObject.Find("board2nd/board1/page1/Labels/Label_1-1").GetComponent <UILabel>();
                component10.transform.localPosition = new Vector3(160f, 139f, 0f);
                component10.fontSize = 24;
                UILabel component11 = GameObject.Find("board2nd/board1/page1/Labels/Label_0-0").GetComponent <UILabel>();
                component11.transform.localPosition = new Vector3(329f, 149f, 0f);
                component11.fontSize = 20;
                component.transform.localPosition = new Vector3(413f, 149f, 0f);
                component.fontSize = 20;
                UITexture component12 = GameObject.Find("board2nd/board1/page1/lines/line_1").GetComponent <UITexture>();
                component12.transform.localPosition = new Vector3(160f, 143f, 0f);
                component12.width  = 556;
                component12.height = 2;
                for (int m = 0; m < 3; m++)
                {
                    for (int n = 0; n < 2; n++)
                    {
                        GameObject gameObject6 = GameObject.Find("board2nd/board1/page1/UIStageCovers/UIStageCover" + (m * 2 + n + 1).ToString());
                        gameObject6.transform.localScale    = Vector3.one * 0.5f;
                        gameObject6.transform.localPosition = new Vector3(12f + 299f * (float)n, 40f - 122f * (float)m, 0f);
                    }
                }
                if (maps.Length == 5)
                {
                    GameObject gameObject7 = GameObject.Find("board2nd/board1/page1/UIStageCovers/UIStageCover5");
                    gameObject7.transform.localPosition = new Vector3(162f, -209f, 0f);
                    GameObject gameObject8 = GameObject.Find("board2nd/board1/page1/UIStageCovers/UIStageCover6");
                    gameObject8.transform.localPosition = new Vector3(162f, 320f, 0f);
                }
            }
            for (int num2 = 0; num2 < maps.Length; num2++)
            {
                UIStageCover component13 = GameObject.Find("board2nd/board1/page1/UIStageCovers/UIStageCover" + (num2 + 1)).GetComponent <UIStageCover>();
                MapModel     mapModel    = maps[num2];
                component13.Initialize(mapModel);
            }
        }