public Skill BuildSkill(object[] rawdata)
        {
            int id = (short)rawdata[0];
            String name = (String)rawdata[1];
            short maxlvl = (short)rawdata[2];
            Skill skill = new Skill(id, name, maxlvl);

            return skill;
        }
        //We make the constructor require a Skill object
        //because future GUI implementations might require lots of info from
        //the skill object and too many parameters look ugly
        public VisualSkill(Skill skill)
        {
            Label = new Label();
            LevelSelector = new NumericUpDown();

            _SkillID = skill.ID;
            Label.Text = skill.Name;

            LevelSelector.Minimum = LevelSelector.Value = 0;
            LevelSelector.Maximum = skill.Maxlvl;

            Label.Height = 15;
            Label.Width = 200;
            LevelSelector.Height = 15;
            LevelSelector.Width = 40;
            this.Height = 40;
            this.Width = 380;

            this.Controls.Add(LevelSelector);
            this.Controls.Add(Label);

            LevelSelector.Location = new Point(220, 0);
            LevelSelector.ValueChanged += new EventHandler(this.OnChanged);
        }
Exemple #3
0
 public void AddRequirement(Skill reqskill, int reqlvl)
 {
     RequiredSkills.Add(new Tuple<Skill, int>(reqskill, reqlvl));
 }
Exemple #4
0
 public void AddDependency(Skill next)
 {
     this.DependentSkills.Add(next);
 }
Exemple #5
0
 public Boolean SkillLevelOk(Skill skill, int reqlvl)
 {
     if (skill._Currentlvl >= reqlvl)
         return true;
     return false;
 }
Exemple #6
0
 public void AddSkill(Skill skill)
 {
     SkillDictionary.Add(skill.ID, skill);
 }