public bool CreateNewUser(ICreateNewUser createInstance, DifficultKind difficult, int firstShip)
        {
            if (this.User_basic != null || createInstance == null)
            {
                return(false);
            }
            this.User_basic = new Mem_basic();
            this.User_basic.SetDifficult(difficult);
            this.User_record       = new Mem_record();
            this.User_turn         = new Mem_turn();
            this.User_trophy       = new Mem_trophy();
            this.User_plus         = new Mem_newgame_plus();
            this.User_deckpractice = new Mem_deckpractice();
            if (this.User_ndock.get_Count() == 0)
            {
                this.Add_Ndock(1);
                this.Add_Ndock(1);
            }
            if (this.User_kdock.get_Count() == 0)
            {
                this.Add_Kdock();
                this.Add_Kdock();
            }
            this.initMaterials(difficult);
            this.Add_Deck(1);
            Comm_UserDatas arg_D2_0 = Comm_UserDatas.Instance;
            List <int>     list     = new List <int>();

            list.Add(firstShip);
            List <int> list2 = arg_D2_0.Add_Ship(list);

            Comm_UserDatas.Instance.User_deck.get_Item(1).Ship[0] = list2.get_Item(0);
            List <Mst_furniture> furnitureDatas = this.User_room.get_Item(1).getFurnitureDatas();
            Mem_furniture        furniture      = null;

            furnitureDatas.ForEach(delegate(Mst_furniture x)
            {
                furniture = new Mem_furniture(x.Id);
                this.User_furniture.Add(furniture.Rid, furniture);
            });
            list = new List <int>();
            list.Add(42);
            list.Add(43);
            this.Add_Slot(list);
            this.User_quest = new Dictionary <int, Mem_quest>();
            using (Dictionary <int, Mst_maparea> .KeyCollection.Enumerator enumerator = Mst_DataManager.Instance.Mst_maparea.get_Keys().GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    int current = enumerator.get_Current();
                    this.Add_EscortDeck(current, current);
                }
            }
            this.initTanker();
            this.UpdateDeckShipLocale();
            return(true);
        }
Exemplo n.º 2
0
        public void LostArea(int maparea_id, List <int> sortieDeckRid)
        {
            Comm_UserDatas commInstance = Comm_UserDatas.Instance;

            if (sortieDeckRid == null)
            {
                sortieDeckRid = new List <int>();
            }
            List <int> lostArea = getLostArea(maparea_id);

            lostArea.ForEach(delegate(int lostAreaId)
            {
                Dictionary <int, Mem_mapclear> dictionary = (from x in commInstance.User_mapclear.Values
                                                             where x.Maparea_id == lostAreaId
                                                             select x).ToDictionary((Mem_mapclear x) => x.Mapinfo_no, (Mem_mapclear y) => y);
                int num = Mst_maparea.MaxMapNum(commInstance.User_basic.Difficult, lostAreaId);
                for (int i = 1; i <= num; i++)
                {
                    if (!dictionary.ContainsKey(i))
                    {
                        int mapinfo_id            = Mst_mapinfo.ConvertMapInfoId(lostAreaId, i);
                        Mem_mapclear mem_mapclear = new Mem_mapclear(mapinfo_id, lostAreaId, i, MapClearState.InvationClose);
                        mem_mapclear.Insert();
                        dictionary.Add(i, mem_mapclear);
                    }
                }
                lostMapClear(dictionary.Values.ToList(), Mst_DataManager.Instance.Mst_maparea[lostAreaId].Neighboring_area);
                Comm_UserDatas.Instance.User_rebellion_point.Remove(lostAreaId);
                List <Mem_tanker> areaTanker = Mem_tanker.GetAreaTanker(lostAreaId);
                lostTanker(areaTanker);
                IEnumerable <Mem_deck> memDeck = from x in commInstance.User_deck.Values
                                                 where x.Area_id == lostAreaId
                                                 select x;
                goBackDeck(memDeck, sortieDeckRid);
                Mem_esccort_deck escort = commInstance.User_EscortDeck[lostAreaId];
                goBackEscortDeck(escort);
                List <Mem_ndock> ndock = (from x in commInstance.User_ndock.Values
                                          where x.Area_id == lostAreaId
                                          select x).ToList();
                lostNdock(ndock);
                Dictionary <enumMaterialCategory, Mem_material> user_material = commInstance.User_material;
                lostMaterial(user_material);
                if (lostAreaId == 1)
                {
                    lostKdock();
                }
            });
        }