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); }
public void AddRequirement(Skill reqskill, int reqlvl) { RequiredSkills.Add(new Tuple<Skill, int>(reqskill, reqlvl)); }
public void AddDependency(Skill next) { this.DependentSkills.Add(next); }
public Boolean SkillLevelOk(Skill skill, int reqlvl) { if (skill._Currentlvl >= reqlvl) return true; return false; }
public void AddSkill(Skill skill) { SkillDictionary.Add(skill.ID, skill); }