コード例 #1
0
ファイル: Certificate.cs プロジェクト: wow4all/evemu_server
        /// <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>();
        }
コード例 #2
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);
            }
        }
コード例 #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_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);
            }
        }
コード例 #4
0
 /// <summary>
 /// Gets the time to next grade.
 /// </summary>
 /// <param name="certificateClass">The certificate class.</param>
 /// <returns>The time required to finish the next grade</returns>
 private static TimeSpan GetTimeToNextLevel(CertificateClass certificateClass)
 {
     CertificateLevel lowestTrinedLevel = certificateClass.Certificate.LowestUntrainedLevel;
     return lowestTrinedLevel?.GetTrainingTime ?? TimeSpan.Zero;
 }
コード例 #5
0
 /// <summary>
 /// Gets the time to elite grade.
 /// </summary>
 /// <param name="certificateClass">The certificate class.</param>
 /// <returns>The time required to finish the final grade</returns>
 private static TimeSpan GetTimeToMaxLevel(CertificateClass certificateClass)
 {
     CertificateLevel levelFive = certificateClass.Certificate.GetCertificateLevel(5);
     return levelFive.IsTrained
         ? TimeSpan.Zero
         : levelFive.GetTrainingTime;
 }
コード例 #6
0
 /// <summary>
 /// Updates a "plan to" menu
 /// </summary>
 /// <param name="menu">The menu to update</param>
 /// <param name="certClass">The selected certificate class</param>
 /// <param name="grade">The grade represent by this menu</param>
 /// <param name="lastEligibleCert">The highest eligible certificate after this plan</param>
 private void UpdatePlanningMenuStatus(ToolStripMenuItem menu, CertificateClass certClass,
                                       CertificateGrade grade, Certificate lastEligibleCert)
 {
     var cert = certClass[grade];
     if (cert == null)
     {
         menu.Visible = false;
     }
     else
     {
         menu.Visible = true;
         if (lastEligibleCert == null) menu.Enabled = true;
         else menu.Enabled = ((int)cert.Grade > (int)lastEligibleCert.Grade);
     }
 }
コード例 #7
0
 /// <summary>
 /// When the user select a new certificate class, we update everything.
 /// </summary>
 /// <param name="sender"></param>
 /// <param name="e"></param>
 private void certSelectControl_SelectionChanged(object sender, EventArgs e)
 {
     SelectedCertificateClass = certSelectControl.SelectedCertificateClass;
 }