Esempio n. 1
0
 protected override void setProperty(XElement element)
 {
     foreach (XElement item in element.Element("_ship").Elements())
     {
         Mem_shipBase mem_shipBase = new Mem_shipBase();
         mem_shipBase.setProperty(item);
         Ship.Add(mem_shipBase);
     }
     foreach (XElement item2 in element.Element("_slotitem").Elements())
     {
         Slotitem.Add(Model_Base.SetUserData <Mem_slotitem>(item2));
     }
     foreach (XElement item3 in element.Element("_furniture").Elements())
     {
         Furniture.Add(Model_Base.SetUserData <Mem_furniture>(item3));
     }
     foreach (XElement item4 in element.Element("_ship_book").Elements())
     {
         Ship_book.Add(Model_Base.SetUserData <Mem_book>(item4));
     }
     foreach (XElement item5 in element.Element("_slot_book").Elements())
     {
         Slot_book.Add(Model_Base.SetUserData <Mem_book>(item5));
     }
     foreach (var item6 in element.Element("_clear").Elements().Select((XElement obj, int idx) => new
     {
         obj,
         idx
     }))
     {
         _clear[item6.idx] = int.Parse(item6.obj.Value);
     }
     FleetLevel = int.Parse(element.Element("_fleetLevel").Value);
     FleetExp   = uint.Parse(element.Element("_fleetExp").Value);
 }
 protected override void setProperty(XElement element)
 {
     using (IEnumerator<XElement> enumerator = element.Element("_ship").Elements().GetEnumerator())
     {
         while (enumerator.MoveNext())
         {
             XElement current = enumerator.get_Current();
             Mem_shipBase mem_shipBase = new Mem_shipBase();
             mem_shipBase.setProperty(current);
             this.Ship.Add(mem_shipBase);
         }
     }
     using (IEnumerator<XElement> enumerator2 = element.Element("_slotitem").Elements().GetEnumerator())
     {
         while (enumerator2.MoveNext())
         {
             XElement current2 = enumerator2.get_Current();
             this.Slotitem.Add(Model_Base.SetUserData<Mem_slotitem>(current2));
         }
     }
     using (IEnumerator<XElement> enumerator3 = element.Element("_furniture").Elements().GetEnumerator())
     {
         while (enumerator3.MoveNext())
         {
             XElement current3 = enumerator3.get_Current();
             this.Furniture.Add(Model_Base.SetUserData<Mem_furniture>(current3));
         }
     }
     using (IEnumerator<XElement> enumerator4 = element.Element("_ship_book").Elements().GetEnumerator())
     {
         while (enumerator4.MoveNext())
         {
             XElement current4 = enumerator4.get_Current();
             this.Ship_book.Add(Model_Base.SetUserData<Mem_book>(current4));
         }
     }
     using (IEnumerator<XElement> enumerator5 = element.Element("_slot_book").Elements().GetEnumerator())
     {
         while (enumerator5.MoveNext())
         {
             XElement current5 = enumerator5.get_Current();
             this.Slot_book.Add(Model_Base.SetUserData<Mem_book>(current5));
         }
     }
     using (var enumerator6 = Enumerable.Select(element.Element("_clear").Elements(), (XElement obj, int idx) => new
     {
         obj,
         idx
     }).GetEnumerator())
     {
         while (enumerator6.MoveNext())
         {
             var current6 = enumerator6.get_Current();
             this._clear.set_Item(current6.idx, int.Parse(current6.obj.get_Value()));
         }
     }
     this.FleetLevel = int.Parse(element.Element("_fleetLevel").get_Value());
     this.FleetExp = uint.Parse(element.Element("_fleetExp").get_Value());
 }
Esempio n. 3
0
        private Mem_ship getMemShip(int rid, int mst_id, int level)
        {
            Mst_ship mst_ship = Mst_DataManager.Instance.Mst_ship[mst_id];
            Array    values   = Enum.GetValues(typeof(Mem_ship.enumKyoukaIdx));
            Dictionary <Mem_ship.enumKyoukaIdx, int> dictionary = new Dictionary <Mem_ship.enumKyoukaIdx, int>();

            foreach (object item in values)
            {
                dictionary.Add((Mem_ship.enumKyoukaIdx)(int) item, 0);
            }
            Mem_shipBase baseData = new Mem_shipBase(rid, mst_ship, level, dictionary);
            Mem_ship     mem_ship = new Mem_ship();

            mem_ship.Set_ShipParam(baseData, mst_ship, enemy_flag: true);
            return(mem_ship);
        }
Esempio n. 4
0
        private void UpdateSupportShip()
        {
            if (SupportKind != SupportKinds.SUPPORTED)
            {
                return;
            }
            Mst_mission2    mst_mission = Mst_DataManager.Instance.Mst_mission[Mission_id];
            int             maxValue    = (mst_mission.Mission_type != MissionType.SupportForward) ? 10 : 5;
            Random          random      = new Random();
            int             subCond     = random.Next(maxValue) + 1;
            double          subFuel     = mst_mission.Use_fuel;
            double          subBull     = mst_mission.Use_bull;
            int             num         = Ship.Count();
            int             num2        = 0;
            List <Mem_ship> list        = new List <Mem_ship>();

            for (int i = 0; i < num; i++)
            {
                if (Ship[i] > 0)
                {
                    Mem_ship mem_ship = Comm_UserDatas.Instance.User_ship[Ship[i]];
                    list.Add(mem_ship);
                    if (Mst_DataManager.Instance.Mst_stype[mem_ship.Stype].IsMother())
                    {
                        num2++;
                    }
                }
            }
            if (num2 >= 3)
            {
                subBull *= 0.5;
            }
            list.ForEach(delegate(Mem_ship x)
            {
                x.SetSubBull_ToMission(subBull);
                x.SetSubFuel_ToMission(subFuel);
                Mem_shipBase mem_shipBase = new Mem_shipBase(x);
                mem_shipBase.Cond        -= subCond;
                if (mem_shipBase.Cond < 0)
                {
                    mem_shipBase.Cond = 0;
                }
                x.Set_ShipParam(mem_shipBase, Mst_DataManager.Instance.Mst_ship[mem_shipBase.Ship_id], enemy_flag: false);
            });
        }
        private Mem_ship getMemShip(int rid, int mst_id, int level)
        {
            Mst_ship mst_ship = Mst_DataManager.Instance.Mst_ship.get_Item(mst_id);
            Array    values   = Enum.GetValues(typeof(Mem_ship.enumKyoukaIdx));
            Dictionary <Mem_ship.enumKyoukaIdx, int> dictionary = new Dictionary <Mem_ship.enumKyoukaIdx, int>();

            using (IEnumerator enumerator = values.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    object current = enumerator.get_Current();
                    dictionary.Add((Mem_ship.enumKyoukaIdx)((int)current), 0);
                }
            }
            Mem_shipBase baseData = new Mem_shipBase(rid, mst_ship, level, dictionary);
            Mem_ship     mem_ship = new Mem_ship();

            mem_ship.Set_ShipParam(baseData, mst_ship, true);
            return(mem_ship);
        }