Beispiel #1
0
        public static Unsetslot fromDynamic(dynamic json)
        {
            Unsetslot unsetslot = new Unsetslot();

            unsetslot.unsetslots = new Dictionary <string, List <int> >();

            foreach (KeyValuePair <string, dynamic> item in json)
            {
                try
                {
                    List <int> values = new List <int>();
                    foreach (var value in item.Value)
                    {
                        values.Add((int)value);
                    }
                    unsetslot.unsetslots.Add(item.Key, values);
                }
                catch
                {
                    // 明示的にnullを追加しておく
                    unsetslot.unsetslots.Add(item.Key, null);
                }
            }

            return(unsetslot);
        }
Beispiel #2
0
        public static Ship3 fromDynamic(dynamic json)
        {
            Ship3 ship3 = new Ship3();

            ship3.ship_data = Ship2.fromDynamic(json.api_ship_data);
            ship3.deck_data = Deck.fromDynamic(json.api_deck_data);
            ship3.slot_data = Unsetslot.fromDynamic(json.api_slot_data);

            return(ship3);
        }