예제 #1
0
 private void secondary4_CheckedChanged(object sender, EventArgs e)
 {
     if (secondary4.Checked)
     {
         secondaryTree = runeTrees[(int)Tree.Inspiration];
         UpdateSecondary();
     }
 }
예제 #2
0
 private void secondary2_CheckedChanged(object sender, EventArgs e)
 {
     if (secondary2.Checked)
     {
         secondaryTree = runeTrees[(int)Tree.Sorcery];
         UpdateSecondary();
     }
 }
예제 #3
0
 private void secondary3_CheckedChanged(object sender, EventArgs e)
 {
     if (secondary3.Checked)
     {
         secondaryTree = runeTrees[(int)Tree.Resolve];
         UpdateSecondary();
     }
 }
예제 #4
0
 private void secondary0_CheckedChanged(object sender, EventArgs e)
 {
     if (secondary0.Checked)
     {
         secondaryTree = runeTrees[(int)Tree.Precision];
         UpdateSecondary();
     }
 }
예제 #5
0
 private void primary4_CheckedChanged(object sender, EventArgs e)
 {
     if (primary4.Checked)
     {
         primaryTree = runeTrees[(int)Tree.Inspiration];
         UpdatePrimary();
     }
 }
예제 #6
0
 private void primary3_CheckedChanged(object sender, EventArgs e)
 {
     if (primary3.Checked)
     {
         primaryTree = runeTrees[(int)Tree.Resolve];
         UpdatePrimary();
     }
 }
예제 #7
0
 private void primary2_CheckedChanged(object sender, EventArgs e)
 {
     if (primary2.Checked)
     {
         primaryTree = runeTrees[(int)Tree.Sorcery];
         UpdatePrimary();
     }
 }
예제 #8
0
 private void primary0_CheckedChanged(object sender, EventArgs e)
 {
     if (primary0.Checked)
     {
         primaryTree = runeTrees[(int)Tree.Precision];
         UpdatePrimary();
     }
 }
예제 #9
0
        public void ParseRunesJson()
        {
            //string jsondir = Directory.GetCurrentDirectory() + "/data/champion.json";
            string jsondir = "C:/Users/kelvi/Documents/Visual Studio 2019/Projects/League/League/resources/runesReforged.json";
            string json    = System.IO.File.ReadAllText(jsondir);

            var trees = JArray.Parse(json);

            var curTree = trees.First;

            // iterate through each rune tree (prec, dom, sorc, res, insp)
            for (int k = 0; k < trees.Count(); k++)
            {
                string treeName     = curTree["name"].ToString();
                int    treeId       = Convert.ToInt32(curTree["id"].ToString());
                string treeIconPath = curTree["icon"].ToString();

                var slots   = curTree["slots"];
                var curSlot = slots.First;

                List <RuneRow> rows = new List <RuneRow>();

                // iterate through each row of runes (keystones, secondaries 1, secondaries 2, secondaries 3)
                for (int j = 0; j < slots.Count(); j++)
                {
                    List <Rune> runes   = new List <Rune>();
                    var         curRune = curSlot["runes"].First;

                    // iterate through each rune in a row (pta, lt, fleet, conq)
                    for (int i = 0; i < curSlot["runes"].Count(); i++)
                    {
                        int    runeId       = Convert.ToInt32(curRune["id"]);
                        string runeIconPath = curRune["icon"].ToString();
                        string runeName     = curRune["name"].ToString();
                        string runeKey      = curRune["key"].ToString();

                        Rune newRune = new Rune(runeId, runeIconPath, runeName, runeKey);
                        runes.Add(newRune);
                        curRune = curRune.Next; // go to next rune in row
                    }
                    RuneRow row = new RuneRow(runes);
                    rows.Add(row);
                    curSlot = curSlot.Next; // go to next row
                }
                RuneTree set = new RuneTree(rows, treeId, treeName, treeIconPath);
                runeTrees.Add(set);
                curTree = curTree.Next; // go to next tree
            }
        }