コード例 #1
0
        public override void OnResponseReceived(dynamic data)
        {
            KCDatabase db = KCDatabase.Instance;

            // Admiral - 各所でバグるので封印
            //db.Admiral.LoadFromResponse( APIName, data.api_basic );


            // Equipments
            db.Equipments.Clear();
            foreach (var elem in data.api_slot_item)
            {
                var eq = new EquipmentData();
                eq.LoadFromResponse(APIName, elem);
                db.Equipments.Add(eq);
            }


            // Arsenal
            foreach (var ars in data.api_kdock)
            {
                int id = (int)ars.api_id;

                if (!db.Arsenals.ContainsKey(id))
                {
                    var a = new ArsenalData();
                    a.LoadFromResponse(APIName, ars);
                    db.Arsenals.Add(a);
                }
                else
                {
                    db.Arsenals[id].LoadFromResponse(APIName, ars);
                }
            }


            // UseItem
            db.UseItems.Clear();
            if (data.api_useitem())
            {
                foreach (var elem in data.api_useitem)
                {
                    var item = new UseItem();
                    item.LoadFromResponse(APIName, elem);
                    db.UseItems.Add(item);
                }
            }

            base.OnResponseReceived((object)data);
        }
コード例 #2
0
        public override void OnResponseReceived(dynamic data)
        {
            KCDatabase db = KCDatabase.Instance;

            db.UseItems.Clear();
            foreach (var elem in data)
            {
                var item = new UseItem();
                item.LoadFromResponse(APIName, elem);
                db.UseItems.Add(item);
            }

            base.OnResponseReceived((object)data);
        }