Beispiel #1
0
        private void bt_ok_Click(object sender, EventArgs e)
        {
            if (tbox_buildname.Text == "")
            {
                MessageBox.Show("Please entar a build name.", "Ooops!");
                return;
            }

            HeroBuild newBuild = new HeroBuild(tbox_buildname.Text, selectedHero);

            HoNBP.NewBuild(newBuild);
            b_flag = true;
            this.Close();
        }
Beispiel #2
0
        public static void LoadHeroFromFile(String filepath)
        {
            try
            {
                XmlReader reader = XmlReader.Create(filepath);

                reader.ReadStartElement("HoNBuildPlanner");
                reader.ReadStartElement("Build");

                m_newBuild = new HeroBuild(reader.ReadElementString("Name"), getHeroByName(reader.ReadElementString("Hero")));
                m_newBuild.MaxLevel(25);
                m_newBuild.Level(25);

                reader.ReadStartElement("Choices");
                for (int i = 1; i <= 25; i++)
                {
                    switch (reader.ReadElementString("Level" + i))
                    {
                        case "Skill1":
                            m_newBuild.Choice(i, LevelChoice.Skill1);
                            break;
                        case "Skill2":
                            m_newBuild.Choice(i, LevelChoice.Skill2);
                            break;
                        case "Skill3":
                            m_newBuild.Choice(i, LevelChoice.Skill3);
                            break;
                        case "SkillUltimate":
                            m_newBuild.Choice(i, LevelChoice.SkillUltimate);
                            break;
                        case "AttributeBooster":
                            m_newBuild.Choice(i, LevelChoice.AttributeBooster);
                            break;
                        default:
                            m_newBuild.Choice(i, LevelChoice.Nothing);
                            break;
                    }

                }
                reader.ReadEndElement();
                reader.ReadEndElement();
                reader.ReadEndElement();
                reader.Close();
            }
            catch (Exception ex)
            {
                exceptionWindow ew = new exceptionWindow(ex.ToString());
                ew.ShowDialog();
            }
        }
Beispiel #3
0
 public static void NewBuild(HeroBuild newBuild)
 {
     m_newBuild = newBuild;
 }
Beispiel #4
0
 public static void ActualBuild(HeroBuild actualBuild)
 {
     m_actualBuild = actualBuild;
 }