Пример #1
0
        /// <summary>
        /// Clones the specified object Armor.
        /// </summary>
        /// <param name="objArmor">The object Armor.</param>
        /// <returns>Armor</returns>
        static public Armor Clone(Armor objArmor)
        {
            Armor objCArmor = new Armor();

            if (objArmor.ArmorID != 0)
            {
                objCArmor.GetArmor(objArmor.ArmorID);
            }
            else
            {
                objCArmor.ArmorID                = 0;
                objCArmor.ArmorDescription       = objArmor.ArmorDescription;
                objCArmor.ArmorName              = objArmor.ArmorName;
                objCArmor.ArmorProficiencyFeatID = objArmor.ArmorProficiencyFeatID;
                objCArmor.ArmorTypeID            = objArmor.ArmorTypeID;
                objCArmor.BookID              = objArmor.BookID;
                objCArmor.Cost                = objArmor.Cost;
                objCArmor.EmplacementPoints   = objArmor.EmplacementPoints;
                objCArmor.FortitudeAdjustment = objArmor.FortitudeAdjustment;
                objCArmor.MaxDefBonus         = objArmor.MaxDefBonus;
                objCArmor.ReflexAdjustment    = objArmor.ReflexAdjustment;
                objCArmor.Weight              = objArmor.Weight;

                objCArmor.lstArmorAvailability = ItemAvailabilityType.Clone(objArmor.lstArmorAvailability);
                Feat objFeat = new Feat(objArmor.objArmorProfFeat.FeatID);
                objCArmor.objArmorProfFeat = objFeat;

                ArmorType objArmorType = new ArmorType(objArmor.objArmorType.ArmorTypeID);
                objCArmor.objArmorType = objArmorType;

                Book objBook = new Book(objArmor.objBook.BookID);
                objCArmor.objBook = objBook;
            }
            return(objCArmor);
        }
        /// <summary>
        /// Clones the specified List of ItemAvailabilityType objects.
        /// </summary>
        /// <param name="lstItemAvailabilityType">The list of ItemAvailabilityType.</param>
        /// <returns>List of ItemAvailabilityType objects</returns>
        static public List <ItemAvailabilityType> Clone(List <ItemAvailabilityType> lstItemAvailabilityType)
        {
            List <ItemAvailabilityType> lstCItemAvailabilityType = new List <ItemAvailabilityType>();

            foreach (ItemAvailabilityType objItemAvailabilityType in lstItemAvailabilityType)
            {
                lstCItemAvailabilityType.Add(ItemAvailabilityType.Clone(objItemAvailabilityType));
            }

            return(lstCItemAvailabilityType);
        }