Beispiel #1
0
 public override int GetHashCode()
 {
     unchecked
     {
         var hashCode = UserId;
         hashCode = (hashCode * 397) ^ PetId;
         hashCode = (hashCode * 397) ^ DateBorn.GetHashCode();
         return(hashCode);
     }
 }
Beispiel #2
0
        public override bool Equals(object obj)
        {
            var student = obj as Student;

            return(student != null &&
                   Guid.Equals(student.Guid) &&
                   CardId == student.CardId &&
                   Name == student.Name &&
                   Surname == student.Surname &&
                   Age == student.Age &&
                   DateBorn.ToString("yyyyMMddhhmmss")
                   == student.DateBorn.ToString("yyyyMMddhhmmss") &&
                   DateRegistry.ToString("yyyyMMddhhmmss")
                   == student.DateRegistry.ToString("yyyyMMddhhmmss"));
        }
Beispiel #3
0
        public override int GetHashCode()
        {
            var hashCode = 1360516050;

            hashCode = hashCode * -1521134295 + EqualityComparer <Guid> .Default.GetHashCode(Guid);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(CardId);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Name);

            hashCode = hashCode * -1521134295 + EqualityComparer <string> .Default.GetHashCode(Surname);

            hashCode = hashCode * -1521134295 + Age.GetHashCode();
            hashCode = hashCode * -1521134295 + DateBorn.GetHashCode();
            hashCode = hashCode * -1521134295 + DateRegistry.GetHashCode();
            return(hashCode);
        }
Beispiel #4
0
 public override string ToString()
 {
     return(string.Format("{0,-17} | {1,3} | {2,4} | {3,3} | {4,-10} | {5,8} | {6,-6}", Name, Age, Gold, HP, Weapon.Type.ToString(), DateBorn.ToShortDateString(), Realm.Name));
 }
Beispiel #5
0
 protected bool Equals(UserPet other)
 {
     return(UserId == other.UserId && PetId == other.PetId && DateBorn.HumanEquals(other.DateBorn));
 }
Beispiel #6
0
 public void ConvertDate()
 {
     this.DateBornString     = DateBorn.ToShortDateString();
     this.DateRegistryString = DateRegistry.ToShortDateString();
 }