Vereinsmeisterschaften  22aa7800eae54b428d40e835886cefe1fdefdfdf
This is a software that can be used to manage the internal competition of the swimming club Illertissen called "Vereinsmeisterschaften".
Loading...
Searching...
No Matches
RudolphTableEntry.cs
1using CommunityToolkit.Mvvm.ComponentModel;
2
4{
8 public partial class RudolphTableEntry : ObservableObject, IEquatable<RudolphTableEntry>, ICloneable
9 {
10 #region Constructors
11
16 {
17 }
18
23 public RudolphTableEntry(RudolphTableEntry other) : this()
24 {
25 if (other == null) { return; }
26 this.Gender = other.Gender;
27 this.Age = other.Age;
28 this.IsOpenAge = other.IsOpenAge;
29 this.SwimmingStyle = other.SwimmingStyle;
30 this.Distance = other.Distance;
31 this.RudolphScore = other.RudolphScore;
32 this.Time = other.Time;
33 }
34
35 #endregion
36
37 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
38
39 #region Basic properties
40
44 [ObservableProperty]
46
50 [ObservableProperty]
51 private byte _age;
52
56 [ObservableProperty]
57 private bool _isOpenAge = false;
58
62 [ObservableProperty]
64
68 [ObservableProperty]
69 private ushort _distance;
70
74 [ObservableProperty]
75 private byte _rudolphScore;
76
80 [ObservableProperty]
81 private TimeSpan _time;
82
83 #endregion
84
85 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
86
87 #region Equality, HashCode, ToString, Clone
88
94 public override bool Equals(object obj)
95 => obj is RudolphTableEntry c && (c.Gender, c.Age, c.SwimmingStyle, c.Distance, c.RudolphScore, c.Time).Equals((Gender, Age, SwimmingStyle, Distance, RudolphScore, Time));
96
102 public bool Equals(RudolphTableEntry other)
103 => Equals((object)other);
104
111 public override int GetHashCode()
112 => base.GetHashCode();
113
118 public override string ToString()
119 => $"{Gender}, Age: {(IsOpenAge ? "open age" : Age)}, {Distance}m {SwimmingStyle}, Rudolph score: {RudolphScore}, Time: {Time}";
120
125 public object Clone()
126 => new RudolphTableEntry(this);
127
128 #endregion
129 }
130}
byte _age
Age for this RudolphTableEntry
override string ToString()
Returns a string that represents the current object.
TimeSpan _time
Time for this RudolphTableEntry
bool _isOpenAge
Is open age attribute for this RudolphTableEntry.
object Clone()
Create a new object that has the same property values than this one.
byte _rudolphScore
Rudolph score for this RudolphTableEntry (between 1 and 20)
RudolphTableEntry()
Constructor for a new RudolphTableEntry object.
ushort _distance
Distance in meters for this RudolphTableEntry (e.g.
Genders _gender
Genders for this RudolphTableEntry
override bool Equals(object obj)
Compare if two RudolphTableEntry are equal.
SwimmingStyles _swimmingStyle
SwimmingStyles for this RudolphTableEntry
bool Equals(RudolphTableEntry other)
Indicates wheather the current object is equal to another object of the same type.
RudolphTableEntry(RudolphTableEntry other)
Clone constructor for a RudolphTableEntry object.
override int GetHashCode()
Serves as the default hash function.
SwimmingStyles
Available swimming styles.
Genders
Available genders for a person.
Definition Genders.cs:7