Exemple #1
0
        /// <summary>
        /// Creates an entry that should be later added
        /// </summary>
        /// <param name="skill"></param>
        /// <param name="level"></param>
        /// <param name="type"></param>
        /// <param name="note"></param>
        /// <param name="lowestPrereqPriority"></param>
        /// <returns></returns>
        private PlanEntry CreateEntryToAdd(StaticSkill skill, Int64 level, PlanEntryType type, string note,
                                           ref int lowestPrereqPriority)
        {
            PlanEntry entry = GetEntry(skill, level);

            // So we have to create a new entry. We first check it's not already learned or something
            if (entry == null)
            {
                return(new PlanEntry(null, skill, level)
                {
                    Type = type,
                    Notes = note
                });
            }

            // If the entry is already in the plan, we create an entry that will never be added to the plan.
            // However, the existing entry's notes and priotity will be updated from this new entry

            // Is the priority the lowest so far (higher numbers = lower priority) ?
            int priority = entry.Priority;

            lowestPrereqPriority = Math.Max(priority, lowestPrereqPriority);

            //Skill at this level is planned - just update the Note.
            entry = new PlanEntry(null, skill, level)
            {
                Priority = priority, Type = type, Notes = note
            };
            return(entry);
        }
Exemple #2
0
        /// <summary>
        /// Deserialization constructor.
        /// </summary>
        /// <param name="owner">The owner.</param>
        /// <param name="serial">The serial.</param>
        internal PlanEntry(BasePlan owner, SerializablePlanEntry serial)
        {
            m_owner = owner;
            m_entryType = serial.Type;
            m_skill = GetSkill(serial);
            m_level = serial.Level;
            m_notes = serial.Notes;
            m_priority = serial.Priority;

            m_planGroups.AddRange(serial.PlanGroups);

            if (serial.Remapping != null)
                m_remapping = new RemappingPoint(serial.Remapping);
        }
Exemple #3
0
        /// <summary>
        /// Deserialization constructor.
        /// </summary>
        /// <param name="owner">The owner.</param>
        /// <param name="serial">The serial.</param>
        internal PlanEntry(BasePlan owner, SerializablePlanEntry serial)
        {
            m_owner     = owner;
            m_entryType = serial.Type;
            m_skill     = GetSkill(serial);
            m_level     = serial.Level;
            m_notes     = serial.Notes;
            m_priority  = serial.Priority;

            m_planGroups.AddRange(serial.PlanGroups);

            if (serial.Remapping != null)
            {
                m_remapping = new RemappingPoint(serial.Remapping);
            }
        }
Exemple #4
0
        /// <summary>
        /// Deserialization constructor
        /// </summary>
        /// <param name="character"></param>
        /// <param name="serial"></param>
        internal PlanEntry(BasePlan owner, SerializablePlanEntry serial)
        {
            m_owner     = owner;
            m_entryType = serial.Type;
            m_skill     = StaticSkills.GetSkillByName(serial.SkillName);
            m_level     = serial.Level;
            m_notes     = serial.Notes;
            m_priority  = serial.Priority;

            foreach (var group in serial.PlanGroups)
            {
                m_planGroups.Add(group);
            }

            if (serial.Remapping != null)
            {
                m_remapping = new RemappingPoint(serial.Remapping);
            }
        }