Ejemplo n.º 1
0
 /// <summary>
 /// Imports and updates from the provided deserialization object
 /// </summary>
 /// <param name="src"></param>
 /// <param name="fromCCP"></param>
 internal void Import(SerializableCharacterSkill src, bool fromCCP)
 {
     m_owned = src.OwnsBook;
     m_known = (fromCCP | src.IsKnown);
     m_currentSkillPoints = src.Skillpoints;
     m_lastConfirmedLvl = src.Level;
     m_level = src.Level;
 }
Ejemplo n.º 2
0
        /// <summary>
        /// Gets the skill properties of a merged skill with a plan entry, if one is provided.
        /// If no plan is provided, the skill properties are returned unmodified.
        /// </summary>
        /// <param name="plan"></param>
        /// <param name="skill"></param>
        /// <returns>The skill properties after the merge</returns>
        private static SerializableCharacterSkill GetMergedSkill(Plan plan, Skill skill)
        {
            var mergedSkill = new SerializableCharacterSkill();

            mergedSkill.ID = skill.ID;
            mergedSkill.Name = skill.Name;
            mergedSkill.IsKnown = skill.IsKnown;
            mergedSkill.OwnsBook = skill.IsOwned;
            mergedSkill.Level = skill.Level;
            mergedSkill.Skillpoints = skill.SkillPoints;

            if (plan != null)
                plan.Merge(mergedSkill);
                
            return mergedSkill;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Gets the skills for each race.
        /// </summary>
        /// <returns></returns>
        private List<SerializableCharacterSkill> GetSkillsForRace()
        {
            var skills = new List<SerializableCharacterSkill>();
            var startingSkills = new Dictionary<int, int>();

            switch (m_race)
            {
                case Race.Amarr:
                    startingSkills = s_allRaceSkills.Concat(s_amarrRaceSkills).ToDictionary(x => x.Key, x => x.Value);
                    break;
                case Race.Caldari:
                    startingSkills = s_allRaceSkills.Concat(s_caldariRaceSkills).ToDictionary(x => x.Key, x => x.Value);
                    break;
                case Race.Gallente:
                    startingSkills = s_allRaceSkills.Concat(s_gallenteRaceSkills).ToDictionary(x => x.Key, x => x.Value);
                    break;
                case Race.Minmatar:
                    startingSkills = s_allRaceSkills.Concat(s_minmatarRaceSkills).ToDictionary(x => x.Key, x => x.Value);
                    break;
            }

            foreach (var raceSkill in startingSkills)
            {
                var staticSkill = StaticSkills.GetSkillById(raceSkill.Key);
                if (staticSkill == null)
                    continue;

                var skill = new SerializableCharacterSkill()
                {
                    ID = raceSkill.Key,
                    Level = raceSkill.Value,
                    Name = StaticSkills.GetSkillById(raceSkill.Key).Name,
                    Skillpoints = StaticSkills.GetSkillById(raceSkill.Key).GetPointsRequiredForLevel(raceSkill.Value),
                    IsKnown = true,
                    OwnsBook = false,
                };

                skills.Add(skill);
            }
            
            return skills;
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Exports the skill to a serialization object
        /// </summary>
        /// <returns></returns>
        internal SerializableCharacterSkill Export()
        {
            var dest = new SerializableCharacterSkill();
            dest.ID = m_staticData.ID;
            dest.Name = m_staticData.Name;
            dest.Level = Math.Min(m_level, 5);
            dest.Skillpoints = m_currentSkillPoints;
            dest.OwnsBook = m_owned;
            dest.IsKnown = m_known;

            return dest;
        }
Ejemplo n.º 5
0
        private List<SerializableCharacterSkill> CreateSerializableCharacterSkillList()
        {
            var ccpSkills = new List<SerializableCharacterSkill>();

            foreach (var group in SkillGroups)
            {
                foreach (var skill in group.Skills)
                {
                    var ccpSkill = new SerializableCharacterSkill();
                    ccpSkill.ID = skill.Id;
                    ccpSkill.IsKnown = true;
                    ccpSkill.Level = skill.Level;
                    ccpSkill.OwnsBook = true;
                    ccpSkill.Skillpoints = skill.SkillPoints;
                    ccpSkills.Add(ccpSkill);
                }
            }

            return ccpSkills;
        }