private void AddNewTalentOrIncreaseLevelOfExistingTalent(Talent newTalent) { if (!InvestedTalents.Contains(newTalent)) { InvestedTalents.Add(newTalent); } /*Reference thing. Don't need the actual Talent stored in the InvestedTalents list to pull the * stat increases and putting nowInvestedTalent back into the list is a waste of time * * todo - maybe figure out how to store nowInvestedTalent as a pointer to the list item */ InvestedTalents.Where(x => x.Profile.Name == newTalent.Profile.Name).First().LevelUp(); var nowInvestedTalent = InvestedTalents.Where(x => x.Profile.Name == newTalent.Profile.Name).First(); foreach (var increase in nowInvestedTalent.GetStatIncreaseForLevel(nowInvestedTalent.Profile.CurrentLevel)) { AddStatIncreaseToCharacterAndRecords(increase); } InvestMoney(newTalent.CostsAtLevel(newTalent.Profile.CurrentLevel)); }
private bool PlayerAlreadyHaveTalent(Talent potentialTalent) { return(InvestedTalents.Contains(potentialTalent)); }
public int TalentLevel(string talentName) { Talent specificTalent = InvestedTalents.Where(x => x.Profile.Name == talentName).First(); return(specificTalent.Profile.CurrentLevel); }