public SkillLevel SkillLevel(Model.Settler.Skill.Skill skill) { if (Experience.ContainsKey(skill)) { return(Skill.SkillLevel.XPtoLevel(Experience[skill])); } else { return(Skill.SkillLevel.Unskilled); } }
public void GainXp(Settlement.Settlement settlement, Model.Settler.Skill.Skill skill, int amount) { var before = SkillLevel(skill); if (Experience.ContainsKey(skill)) { Experience[skill] += amount; } else { Experience.Add(skill, amount); } if (before < SkillLevel(skill)) { settlement.MessageManager.TodaysMessages.Add(new SkillIncreasedMessage(this, skill, SkillLevel(skill))); } }