コード例 #1
0
        public MedicineInfo(Health health, PhysiologicalCharacteristics physiologicalCharacteristics,
                            SportInfo sportInfo)
        {
            if (health == null)
            {
                throw new ArgumentNullException(nameof(health));
            }

            if (physiologicalCharacteristics == null)
            {
                throw new ArgumentNullException(nameof(physiologicalCharacteristics));
            }

            Health = health;
            PhysiologicalCharacteristics = physiologicalCharacteristics;
            SportInfo = sportInfo ?? new SportInfo();
        }
コード例 #2
0
 public override int GetHashCode()
 {
     return(Health.GetHashCode() ^
            PhysiologicalCharacteristics.GetHashCode() ^
            SportInfo.GetHashCode());
 }