Beispiel #1
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (Name.Length != 0)
            {
                hash ^= Name.GetHashCode();
            }
            if (Job != 0)
            {
                hash ^= Job.GetHashCode();
            }
            if (Age != 0)
            {
                hash ^= Age.GetHashCode();
            }
            if (Gender.Length != 0)
            {
                hash ^= Gender.GetHashCode();
            }
            return(hash);
        }
Beispiel #2
0
 public override string ToString()
 {
     return
         ($"[{Id}] {Name ?? "---"} {(DateOfBirth != null ? DateOfBirth.ToString() : "---")} {Age.ToString() ?? "---"} " +
          $"[{string.Join(",", Awards.ConvertAll(a => $"{a.Id} {a.Title}"))}]");
 }
Beispiel #3
0
 public virtual void setAge(Age age)
 {
     this.age = age;
 }
Beispiel #4
0
 /// <summary>
 /// Override of ToString in order to get information needed.
 /// </summary>
 /// <returns>string</returns>
 public override string ToString()
 {
     return(Id.ToString() + NickName.ToString() + Age.ToString() + Role.ToString() + TeamId.ToString());
 }