1using CommunityToolkit.Mvvm.ComponentModel;
8 public partial class PersonStart : ObservableObject, IEquatable<PersonStart>, ICloneable
25 if (other ==
null) {
return; }
26 this.PersonObj = other.PersonObj;
28 this.Style = other.Style;
29 this.Time = other.
Time;
30 this.Score = other.Score;
31 this.IsHighlighted = other.IsHighlighted;
32 this.IsActive = other.IsActive;
39 #region Basic properties
53 private TimeSpan _time;
62 if (SetProperty(ref _time, value))
90 #region Competition related properties
98 get => _competitionObj;
101 if (SetProperty(ref _competitionObj, value))
131 #region Other properties
143 #region Equality, HashCode, ToString, Clone
151 => obj is
PersonStart s && (s.PersonObj, s.Style, s.Time, s.IsActive).
Equals((PersonObj, Style,
Time, IsActive));
173 => $
"{(!IsActive ? "Inactive
" : "")}Start for {PersonObj} in {Style}" + (
CompetitionObj !=
null ? $
" (Distance: {CompetitionObj.Distance}m)" :
"");
Class describing a competition.
Class describing a person.
PersonStart(PersonStart other)
Clone constructor for a new PersonStart object.
object Clone()
Create a new object that has the same property values than this one.
bool _isHighlighted
Flag indicating if this start should be highlighted in the UI.
bool IsTimeSet
True if the Time is set (not TimeSpan.Zero)
bool _isUsingMaxAgeCompetition
Flag indicating if this start is using a competition that was found by the max available age.
Person _personObj
Reference to the person object to which the start belongs.
bool _isActive
Indicates if this start is currently active.
bool IsCompetitionObjAssigned
Flag indicating if the CompetitionObj is assigned (CompetitionObj != null).
override string ToString()
Returns a string that represents the current object.
SwimmingStyles _style
SwimmingStyles of the start
double _score
Score of the person for this start.
PersonStart()
Constructor for a new PersonStart object.
bool _isUsingExactAgeCompetition
Flag indicating if this start is using a competition for which the age of the person matches the comp...
bool Equals(PersonStart other)
Indicates wheather the current object is equal to another object of the same type.
TimeSpan Time
Time the person needed during the race of this start.
Competition CompetitionObj
Reference to the competition object to which the start belongs.
override bool Equals(object obj)
Compare if two PersonStarts are equal.
override int GetHashCode()
Serves as the default hash function.
SwimmingStyles
Available swimming styles.