/// <summary>
 /// Constructor
 /// </summary>
 /// <param name="tree">parent tree</param>
 /// <param name="skill">skill option</param>
 public SkillOption(Tree tree, Skill skill)
 {
     InitializeComponent();
     optionBox.Content = skill.name;
     optionBox.IsChecked = false;
     foreach (string s in tree.skills) {
         if (s.ToLower().Equals(skill.name)) {
             optionBox.IsChecked = true;
             break;
         }
     }
 }
        /// <summary>
        /// Constructor
        /// </summary>
        /// <param name="tree">tree to edit</param>
        public TreeProperties(MainPage parent, Tree tree)
        {
            InitializeComponent();

            this.parent = parent;
            this.tree = tree;

            // Filters
            nameBox.TextChanged += Filter.FilterString;
            prefixBox.TextChanged += Filter.FilterString;
            permissionBox.TextChanged += Filter.FilterString;
            maxLevelBox.TextChanged += Filter.FilterInt;
            professLevelBox.TextChanged += Filter.FilterInt;
            healthBaseBox.TextChanged += Filter.FilterDouble;
            healthBonusBox.TextChanged += Filter.FilterDouble;
            manaBaseBox.TextChanged += Filter.FilterDouble;
            manaBonusBox.TextChanged += Filter.FilterDouble;

            Apply();
        }
示例#3
0
        /// <summary>
        /// Creates a new class
        /// </summary>
        public void CreateNewClass()
        {
            // Get the next available default name
            int id = 0;
            bool exists = false;
            do {
                exists = false;
                id++;
                foreach (Tree tree in trees) {
                    if (tree.name.ToLower().Equals(DEFAULT_CLASS_NAME.ToLower() + id)) {
                        exists = true;
                        break;
                    }
                }
            }
            while (exists);

            ClearMainGrid();
            Tree newTree = new Tree(DEFAULT_CLASS_NAME + id);
            mainGrid.Children.Add(new TreeProperties(this, newTree));
            classList.Items.Add(newTree.name);
            trees.Add(newTree);
            classList.SelectedIndex = classList.Items.Count - 1;
        }