コード例 #1
0
        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));
        }
コード例 #2
0
 private bool PlayerAlreadyHaveTalent(Talent potentialTalent)
 {
     return(InvestedTalents.Contains(potentialTalent));
 }
コード例 #3
0
        public int TalentLevel(string talentName)
        {
            Talent specificTalent = InvestedTalents.Where(x => x.Profile.Name == talentName).First();

            return(specificTalent.Profile.CurrentLevel);
        }