Пример #1
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="character">The character</param>
 /// <param name="src">The static certificate class</param>
 /// <param name="category">The owning category</param>
 internal CertificateClass(Character character, StaticCertificateClass src, CertificateGroup category)
 {
     Character   = character;
     Category    = category;
     StaticData  = src;
     Certificate = new Certificate(character, src.Certificate, this);
 }
Пример #2
0
 /// <summary>
 /// Constructor.
 /// </summary>
 /// <param name="character">The character</param>
 /// <param name="src">The static certificate class</param>
 /// <param name="category">The owning category</param>
 internal CertificateClass(Character character, StaticCertificateClass src, CertificateGroup category)
 {
     Character = character;
     Category = category;
     StaticData = src;
     Certificate = new Certificate(character, src.Certificate, this);
 }
Пример #3
0
        /// <summary>
        /// Constructor from XML.
        /// </summary>
        /// <param name="certClass"></param>
        /// <param name="src"></param>
        internal StaticCertificate(StaticCertificateClass certClass, SerializableCertificate src)
        {
            ID = src.ID;
            Description = src.Description;
            Class = certClass;
            Grades = new Dictionary<CertificateGrade, List<StaticSkillLevel>>();

            // Recommendations
            Recommendations = new StaticRecommendations<Item>();
            if (src.Recommendations == null || StaticItems.ShipsMarketGroup == null)
                return;

            foreach (Ship ship in src.Recommendations
                .Select(recommendation => StaticItems.ShipsMarketGroup.AllItems.OfType<Ship>()
                    .FirstOrDefault(item => item.Name == recommendation.ShipName))
                .Where(ship => ship != null))
            {
                ship.Recommendations.Add(this);
                Recommendations.Add(ship);
            }
        }
Пример #4
0
        /// <summary>
        /// Constructor from XML
        /// </summary>
        /// <param name="certClass"></param>
        /// <param name="element"></param>
        internal StaticCertificate(StaticCertificateClass certClass, SerializableCertificate src)
        {
            m_class = certClass;

            m_id          = src.ID;
            m_grade       = src.Grade;
            m_description = src.Description;

            // Recommendations
            if (src.Recommendations != null)
            {
                foreach (var recommendation in src.Recommendations)
                {
                    var ship = StaticItems.Ships.AllItems.FirstOrDefault(x => x.Name == recommendation.Ship) as Ship;
                    if (ship != null)
                    {
                        ship.Recommendations.Add(this);
                        m_recommendations.Add(ship);
                    }
                }
            }
        }
Пример #5
0
		/// <summary>
		/// Constructor from XML
		/// </summary>
		/// <param name="certClass"></param>
		/// <param name="element"></param>
		internal StaticCertificate(StaticCertificateClass certClass, SerializableCertificate src)
		{
			m_class = certClass;

			m_id = src.ID;
			m_grade = src.Grade;
			m_description = src.Description;

			// Recommendations
			if (src.Recommendations != null)
			{
				foreach (var recommendation in src.Recommendations)
				{
					var ship = StaticItems.Ships.AllItems.FirstOrDefault(x => x.Name == recommendation.Ship) as Ship;
					if (ship != null)
					{
						ship.Recommendations.Add(this);
						m_recommendations.Add(ship);
					}
				}
			}
		}
Пример #6
0
        /// <summary>
        /// Constructor from XML.
        /// </summary>
        /// <param name="certClass"></param>
        /// <param name="src"></param>
        internal StaticCertificate(StaticCertificateClass certClass, SerializableCertificate src)
        {
            ID          = src.ID;
            Description = src.Description;
            Class       = certClass;
            Grades      = new Dictionary <CertificateGrade, List <StaticSkillLevel> >();

            // Recommendations
            Recommendations = new StaticRecommendations <Item>();
            if (src.Recommendations == null || StaticItems.ShipsMarketGroup == null)
            {
                return;
            }

            foreach (Ship ship in src.Recommendations
                     .Select(recommendation => StaticItems.ShipsMarketGroup.AllItems.OfType <Ship>()
                             .FirstOrDefault(item => item.Name == recommendation.ShipName))
                     .Where(ship => ship != null))
            {
                ship.Recommendations.Add(this);
                Recommendations.Add(ship);
            }
        }