示例#1
0
 /// <summary>
 /// Deserialization constructor.
 /// </summary>
 /// <param name="group"></param>
 /// <param name="src"></param>
 internal StaticCertificateClass(StaticCertificateGroup group, SerializableCertificateClass src)
 {
     ID          = src.ID;
     Name        = src.Name;
     Description = src.Description;
     Group       = group;
     Certificate = new StaticCertificate(this, src.Certificate);
 }
示例#2
0
 /// <summary>
 /// Deserialization constructor.
 /// </summary>
 /// <param name="group"></param>
 /// <param name="src"></param>
 internal StaticCertificateClass(StaticCertificateGroup group, SerializableCertificateClass src)
 {
     ID = src.ID;
     Name = src.Name;
     Description = src.Description;
     Group = group;
     Certificate = new StaticCertificate(this, src.Certificate);
 }
示例#3
0
        /// <summary>
        /// Constructor at character's initialization time
        /// </summary>
        /// <param name="character"></param>
        /// <param name="src"></param>
        /// <param name="certClass"></param>
        internal Certificate(Character character, StaticCertificate src, CertificateClass certClass)
        {
            m_staticData = src;
            m_class = certClass;
            m_character = character;
            m_status = CertificateStatus.Untrained;

            m_prereqSkills = new List<SkillLevel>(src.PrerequisiteSkills.ToCharacter(character));
            m_prereqCertificates = new List<Certificate>();
        }
示例#4
0
        /// <summary>
        /// Constructor at character's initialization time.
        /// </summary>
        /// <param name="character"></param>
        /// <param name="src"></param>
        /// <param name="certClass"></param>
        internal Certificate(Character character, StaticCertificate src, CertificateClass certClass)
        {
            m_character = character;
            m_levels    = new CertificateLevel[6];

            StaticData = src;
            Class      = certClass;

            foreach (KeyValuePair <CertificateGrade, List <StaticSkillLevel> > skill in src.PrerequisiteSkills)
            {
                m_levels[(int)skill.Key] = new CertificateLevel(skill, this, character);
            }
        }
示例#5
0
        /// <summary>
        /// Constructor at character's initialization time.
        /// </summary>
        /// <param name="character"></param>
        /// <param name="src"></param>
        /// <param name="certClass"></param>
        internal Certificate(Character character, StaticCertificate src, CertificateClass certClass)
        {
            m_character = character;
            m_levels = new CertificateLevel[6];

            StaticData = src;
            Class = certClass;

            foreach (KeyValuePair<CertificateGrade, List<StaticSkillLevel>> skill in src.PrerequisiteSkills)
            {
                m_levels[(int)skill.Key] = new CertificateLevel(skill, this, character);
            }
        }
示例#6
0
 /// <summary>
 /// Completes the initialization by updating the prerequisites
 /// </summary>
 internal void CompleteInitialization(SerializableCertificatePrerequisite[] prereqs)
 {
     foreach (var prereq in prereqs)
     {
         // Skills
         if (prereq.Kind == SerializableCertificatePrerequisiteKind.Skill)
         {
             m_prerequisiteSkills.Add(new StaticSkillLevel(prereq.Name, Int32.Parse(prereq.Level)));
         }
         // Certificates
         else
         {
             var grade = StaticCertificate.GetGrade(prereq.Level);
             m_prerequisiteCertificates.Add(StaticCertificates.GetCertificateClass(prereq.Name)[grade]);
         }
     }
 }
        /// <summary>
        /// Recursive method to generate treenodes for tvCertList.
        /// </summary>
        /// <param name="certificate">An EntityRecommendedCertificate object</param>
        /// <returns></returns>
        private TreeNode GetCertNode(StaticCertificate certificate)
        {
            var character = (Character)m_plan.Character;
            Certificate cert = character.Certificates[certificate.ID];

            TreeNode node = new TreeNode(cert.ToString());
            node.Tag = cert;

            // Generate child certificate nodes if required
            foreach (StaticCertificate childCert in cert.StaticData.PrerequisiteCertificates)
            {
                node.Nodes.Add(GetCertNode(childCert));

            }

            // Generate prerequisites skill nodes if required
            foreach (StaticSkillLevel prereq in cert.StaticData.PrerequisiteSkills)
            {
                node.Nodes.Add(GetSkillNode(prereq));
            }

            return node;
        }