public Mem_book Add_Book(int type, int mst_id)
        {
            Dictionary <int, Mem_book> dictionary = (type != 1) ? this.Slot_book : this.Ship_book;
            Mem_book mem_book = null;

            if (dictionary.TryGetValue(mst_id, ref mem_book))
            {
                return(mem_book);
            }
            mem_book = new Mem_book(type, mst_id);
            if (type != 1)
            {
                dictionary.Add(mst_id, mem_book);
                return(mem_book);
            }
            string yomi = Mst_DataManager.Instance.Mst_ship.get_Item(mem_book.Table_id).Yomi;
            bool   flag = Enumerable.Any <Mem_book>(this.Ship_book.get_Values(), (Mem_book x) => Mst_DataManager.Instance.Mst_ship.get_Item(x.Table_id).Yomi.Equals(yomi) && x.Flag2 == 1);

            if (flag)
            {
                mem_book.UpdateShipBook(true, false);
            }
            dictionary.Add(mst_id, mem_book);
            return(mem_book);
        }
        public void UpdateShipBookBrokenClothState(List <int> targetShipIds)
        {
            HashSet <string> check_yomi = new HashSet <string>();

            targetShipIds.ForEach(delegate(int x)
            {
                check_yomi.Add(Mst_DataManager.Instance.Mst_ship.get_Item(x).Yomi);
            });
            if (check_yomi.get_Count() == 0)
            {
                return;
            }
            List <Mst_ship> list = Enumerable.ToList <Mst_ship>(Enumerable.Where <Mst_ship>(Mst_DataManager.Instance.Mst_ship.get_Values(), (Mst_ship y) => check_yomi.Contains(y.Yomi)));

            list.ForEach(delegate(Mst_ship up_item)
            {
                Mem_book mem_book = null;
                if (Comm_UserDatas.Instance.Ship_book.TryGetValue(up_item.Id, ref mem_book))
                {
                    mem_book.UpdateShipBook(true, false);
                }
            });
        }
Exemple #3
0
        public void UpdateShipBookBrokenClothState(List <int> targetShipIds)
        {
            HashSet <string> check_yomi = new HashSet <string>();

            targetShipIds.ForEach(delegate(int x)
            {
                check_yomi.Add(Mst_DataManager.Instance.Mst_ship[x].Yomi);
            });
            if (check_yomi.Count != 0)
            {
                List <Mst_ship> list = (from y in Mst_DataManager.Instance.Mst_ship.Values
                                        where check_yomi.Contains(y.Yomi)
                                        select y).ToList();
                list.ForEach(delegate(Mst_ship up_item)
                {
                    Mem_book value = null;
                    if (Instance.Ship_book.TryGetValue(up_item.Id, out value))
                    {
                        value.UpdateShipBook(damage: true, mariage: false);
                    }
                });
            }
        }
Exemple #4
0
        public Mem_book Add_Book(int type, int mst_id)
        {
            Dictionary <int, Mem_book> dictionary = (type != 1) ? Slot_book : Ship_book;
            Mem_book value = null;

            if (dictionary.TryGetValue(mst_id, out value))
            {
                return(value);
            }
            value = new Mem_book(type, mst_id);
            if (type != 1)
            {
                dictionary.Add(mst_id, value);
                return(value);
            }
            string yomi = Mst_DataManager.Instance.Mst_ship[value.Table_id].Yomi;

            if (Ship_book.Values.Any((Mem_book x) => (Mst_DataManager.Instance.Mst_ship[x.Table_id].Yomi.Equals(yomi) && x.Flag2 == 1) ? true : false))
            {
                value.UpdateShipBook(damage: true, mariage: false);
            }
            dictionary.Add(mst_id, value);
            return(value);
        }