Exemple #1
0
        private static SummonerSpell parseSummonerSpellJSON(JSONNode json)
        {
            Chompers.Image image = Image.ParseImageJson(json["image"]);

            // TODO: Fix below
            List <List <float> > effect = new List <List <float> >();

            for (int i = 0; i < json["effect"].Count; i++)
            {
                effect.Add(Chompers.Chompers.parseFloatArrayJSON((json["effect"].AsArray)[i].AsArray));
            }

            List <Chompers.Chompers.Var> vars = new List <Chompers.Chompers.Var>();

            foreach (JSONNode varJSON in json["vars"])
            {
                vars.Add(new Chompers.Chompers.Var(varJSON["link"], varJSON["coeff"], varJSON["key"]));
            }
            // TODO: Fix above

            return(new SummonerSpell(json["id"], json["name"], json["description"],
                                     json["tooltip"], json["maxrank"], Chompers.Chompers.parseIntArrayJSON(json["cooldown"].AsArray),
                                     json["cooldownBurn"], Chompers.Chompers.parseIntArrayJSON(json["cost"].AsArray),
                                     json["costBurn"], json["dataValues"], effect,
                                     Chompers.Chompers.parseStringArrayJSON(json["effectBurn"].AsArray), vars, json["key"],
                                     Chompers.Chompers.parseStringArrayJSON(json["modes"].AsArray), json["costType"],
                                     json["maxAmmo"], Chompers.Chompers.parseIntArrayJSON(json["range"].AsArray),
                                     json["rangeBurn"], image, json["resource"]));
        }
Exemple #2
0
        private static Rune parseRuneJSON(JSONNode runeJSON, int runeId)
        {
            Chompers.Image image = Image.ParseImageJson(runeJSON["image"]);

            return(new Rune(runeId, runeJSON["name"], image, runeJSON["tier"], runeJSON["type"],
                            Chompers.Chompers.parseStringFloatDictionaryJSON(runeJSON["stats"]),
                            Chompers.Chompers.parseStringArrayJSON(runeJSON["tags"].AsArray), runeJSON["colloq"], runeJSON["plaintext"]));
        }