Esempio n. 1
0
 protected Equipment(string name, string description, int value, int weight, int id, Rarity r, EquipmentType t, Stats s) : base(name, description, value, weight, id, r)
 {
     if (!t.Equals(null) && !s.Equals(null))
     {
         Type         = t;
         Requirements = s;
     }
     else
     {
         throw new System.ArgumentException("An Item can't be constructed by null arguments or negative integers");
     }
 }
Esempio n. 2
0
        /// <summary>
        /// Returns true if EquipmentViewModel instances are equal
        /// </summary>
        /// <param name="other">Instance of EquipmentViewModel to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(EquipmentViewModel other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Id == other.Id ||
                     Id.Equals(other.Id)
                     ) &&
                 (
                     EquipmentType == other.EquipmentType ||
                     EquipmentType != null &&
                     EquipmentType.Equals(other.EquipmentType)
                 ) &&
                 (
                     OwnerName == other.OwnerName ||
                     OwnerName != null &&
                     OwnerName.Equals(other.OwnerName)
                 ) &&
                 (
                     OwnerId == other.OwnerId ||
                     OwnerId != null &&
                     OwnerId.Equals(other.OwnerId)
                 ) &&
                 (
                     IsHired == other.IsHired ||
                     IsHired.Equals(other.IsHired)
                 ) &&
                 (
                     SeniorityString == other.SeniorityString ||
                     SeniorityString != null &&
                     SeniorityString.Equals(other.SeniorityString)
                 ) &&
                 (
                     Make == other.Make ||
                     Make != null &&
                     Make.Equals(other.Make)
                 ) &&
                 (
                     Model == other.Model ||
                     Model != null &&
                     Model.Equals(other.Model)
                 ) &&
                 (
                     Size == other.Size ||
                     Size != null &&
                     Size.Equals(other.Size)
                 ) &&
                 (
                     EquipmentCode == other.EquipmentCode ||
                     EquipmentCode != null &&
                     EquipmentCode.Equals(other.EquipmentCode)
                 ) &&
                 (
                     AttachmentCount == other.AttachmentCount ||
                     AttachmentCount.Equals(other.AttachmentCount)
                 ) &&
                 (
                     LastVerifiedDate == other.LastVerifiedDate ||
                     LastVerifiedDate != null &&
                     LastVerifiedDate.Equals(other.LastVerifiedDate)
                 ) &&
                 (
                     SenioritySortOrder == other.SenioritySortOrder ||
                     SenioritySortOrder.Equals(other.SenioritySortOrder)
                 ));
        }
Esempio n. 3
0
        /// <summary>
        /// Returns true if SeniorityViewModel instances are equal
        /// </summary>
        /// <param name="other">Instance of SeniorityViewModel to be compared</param>
        /// <returns>Boolean</returns>
        public bool Equals(SeniorityViewModel other)
        {
            if (other is null)
            {
                return(false);
            }
            if (ReferenceEquals(this, other))
            {
                return(true);
            }

            return
                ((
                     Id == other.Id ||
                     Id.Equals(other.Id)
                     ) &&
                 (
                     EquipmentType == other.EquipmentType ||
                     EquipmentType != null &&
                     EquipmentType.Equals(other.EquipmentType)
                 ) &&
                 (
                     OwnerName == other.OwnerName ||
                     OwnerName != null &&
                     OwnerName.Equals(other.OwnerName)
                 ) &&
                 (
                     OwnerId == other.OwnerId ||
                     OwnerId != null &&
                     OwnerId.Equals(other.OwnerId)
                 ) &&
                 (
                     SeniorityString == other.SeniorityString ||
                     SeniorityString != null &&
                     SeniorityString.Equals(other.SeniorityString)
                 ) &&
                 (
                     Seniority == other.Seniority ||
                     Seniority != null &&
                     Seniority.Equals(other.Seniority)
                 ) &&
                 (
                     Make == other.Make ||
                     Make != null &&
                     Make.Equals(other.Make)
                 ) &&
                 (
                     Model == other.Model ||
                     Model != null &&
                     Model.Equals(other.Model)
                 ) &&
                 (
                     Size == other.Size ||
                     Size != null &&
                     Size.Equals(other.Size)
                 ) &&
                 (
                     EquipmentCode == other.EquipmentCode ||
                     EquipmentCode != null &&
                     EquipmentCode.Equals(other.EquipmentCode)
                 ) &&
                 (
                     LastCalled == other.LastCalled ||
                     LastCalled != null &&
                     LastCalled.Equals(other.LastCalled)
                 ) &&
                 (
                     YearsRegistered == other.YearsRegistered ||
                     YearsRegistered != null &&
                     YearsRegistered.Equals(other.YearsRegistered)
                 ) &&
                 (
                     YtdHours == other.YtdHours ||
                     YtdHours != null &&
                     YtdHours.Equals(other.YtdHours)
                 ) &&
                 (
                     HoursYearMinus1 == other.HoursYearMinus1 ||
                     HoursYearMinus1 != null &&
                     HoursYearMinus1.Equals(other.HoursYearMinus1)
                 ) &&
                 (
                     HoursYearMinus2 == other.HoursYearMinus2 ||
                     HoursYearMinus2 != null &&
                     HoursYearMinus2.Equals(other.HoursYearMinus2)
                 ) &&
                 (
                     HoursYearMinus3 == other.HoursYearMinus3 ||
                     HoursYearMinus3 != null &&
                     HoursYearMinus3.Equals(other.HoursYearMinus3)
                 ) &&
                 (
                     SenioritySortOrder == other.SenioritySortOrder ||
                     SenioritySortOrder.Equals(other.SenioritySortOrder)
                 ));
        }