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
Person.cs
1using CommunityToolkit.Mvvm.ComponentModel;
2using System.Collections.ObjectModel;
5
7{
11 public class Person : ObservableObject, IEquatable<Person>, ICloneable
12 {
13 #region Constructors
14
18 public Person()
19 {
20 Starts = new Dictionary<SwimmingStyles, PersonStart>();
21 List<SwimmingStyles> availableSwimmingStyles = Enum.GetValues(typeof(SwimmingStyles)).Cast<SwimmingStyles>().ToList();
22 availableSwimmingStyles.Remove(SwimmingStyles.Unknown);
23 foreach(SwimmingStyles style in availableSwimmingStyles)
24 {
25 Starts.Add(style, null);
26
27 // prepare a PersonStart object for each style and store it in the available starts dictionary
28 PersonStart newStart = new PersonStart() { Style = style, PersonObj = this };
29 newStart.PropertyChanged += PersonStart_PropertyChanged;
30 _availableStartsDict.Add(style, newStart);
31 }
32 }
33
38 public Person(Person other) : this()
39 {
40 if (other == null) { return; }
41 this.Name = other.Name;
42 this.FirstName = other.FirstName;
43 this.Gender = other.Gender;
44 this.BirthYear = other.BirthYear;
45
46 // Shallow clone of the Friends list
47 this.FriendGroupIDs = (other.FriendGroupIDs != null) ? new ObservableCollection<int>(other.FriendGroupIDs) : null;
48 this.Friends = (other.Friends != null) ? new List<Person>(other.Friends) : null;
49
50 // Deep clone of the Starts dictionary
51 this.Starts = other.Starts.ToDictionary(kvp => kvp.Key, kvp => kvp.Value?.Clone() as PersonStart);
52 }
53
54 #endregion
55
56 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
57
58 #region Basic properties
59
60 private string _name = string.Empty;
64 [FileServiceOrder]
65 public string Name
66 {
67 get => _name;
68 set => SetProperty(ref _name, value);
69 }
70
71 private string _firstName = string.Empty;
75 [FileServiceOrder]
76 public string FirstName
77 {
78 get => _firstName;
79 set => SetProperty(ref _firstName, value);
80 }
81
82 private Genders _gender;
86 [FileServiceOrder]
88 {
89 get => _gender;
90 set => SetProperty(ref _gender, value);
91 }
92
93 private UInt16 _birthYear;
97 [FileServiceOrder]
98 public UInt16 BirthYear
99 {
100 get => _birthYear;
101 set => SetProperty(ref _birthYear, value);
102 }
103
104 #endregion
105
106 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
107
108 #region Competition related properties
109
110 private Dictionary<SwimmingStyles, Competition> _availableCompetitions = new Dictionary<SwimmingStyles, Competition>();
114 [FileServiceIgnore]
115 public Dictionary<SwimmingStyles, Competition> AvailableCompetitions
116 {
117 get => _availableCompetitions;
118 set
119 {
120 if (SetProperty(ref _availableCompetitions, value))
121 {
122 OnPropertyChanged(nameof(AvailableCompetitionsFlags));
123 }
124 }
125 }
126
130 [FileServiceIgnore]
131 public Dictionary<SwimmingStyles, bool> AvailableCompetitionsFlags
132 {
133 get
134 {
135 Dictionary<SwimmingStyles, bool> availableCompetitionsFlags = new Dictionary<SwimmingStyles, bool>();
136 foreach (KeyValuePair<SwimmingStyles, Competition> kvp in AvailableCompetitions)
137 {
138 availableCompetitionsFlags.Add(kvp.Key, kvp.Value != null);
139 }
140 return availableCompetitionsFlags;
141 }
142 }
143
147 [FileServiceIgnore]
148 public Dictionary<SwimmingStyles, int> AvailableCompetitionsIDs
149 {
150 get
151 {
152 Dictionary<SwimmingStyles, int> availableCompetitionsIDs = new Dictionary<SwimmingStyles, int>();
153 foreach (KeyValuePair<SwimmingStyles, Competition> kvp in AvailableCompetitions)
154 {
155 availableCompetitionsIDs.Add(kvp.Key, kvp.Value?.Id ?? -1);
156 }
157 return availableCompetitionsIDs;
158 }
159 }
160
161 private Dictionary<SwimmingStyles, bool> _isUsingMaxAgeCompetitionDict = new Dictionary<SwimmingStyles, bool>();
165 [FileServiceIgnore]
166 public Dictionary<SwimmingStyles, bool> IsUsingMaxAgeCompetitionDict
167 {
168 get => _isUsingMaxAgeCompetitionDict;
169 set => SetProperty(ref _isUsingMaxAgeCompetitionDict, value);
170 }
171
172 private Dictionary<SwimmingStyles, bool> _isUsingExactAgeCompetitionDict = new Dictionary<SwimmingStyles, bool>();
176 [FileServiceIgnore]
177 public Dictionary<SwimmingStyles, bool> IsUsingExactAgeCompetitionDict
178 {
179 get => _isUsingExactAgeCompetitionDict;
180 set => SetProperty(ref _isUsingExactAgeCompetitionDict, value);
181 }
182
183 #endregion
184
185 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
186
187 #region Starts management
188
193 private Dictionary<SwimmingStyles, PersonStart> _availableStartsDict = new Dictionary<SwimmingStyles, PersonStart>();
194
195 private Dictionary<SwimmingStyles, PersonStart> _starts = new Dictionary<SwimmingStyles, PersonStart>();
199 [FileServiceIgnore]
200 public Dictionary<SwimmingStyles, PersonStart> Starts
201 {
202 get => _starts;
203 set => SetProperty(ref _starts, value);
204 }
205
209 [FileServiceIgnore]
210 public bool HasStarts => Starts?.Values?.Any(s => s != null) ?? false;
211
218 {
219 return Starts[style];
220 }
221
227 public void SetStartAvailable(SwimmingStyles style, bool available)
228 {
229 PersonStart start = GetStartByStyle(style);
230 if (start == null && available)
231 {
232 Starts[style] = _availableStartsDict[style];
233 }
234 else if (start != null && !available)
235 {
236 Starts[style] = null;
237 }
238 OnPropertyChanged(nameof(Starts));
239 OnPropertyChanged(nameof(HasStarts));
240 OnPropertyChanged(nameof(IsActive));
241 }
242
248 public void SetStartTime(SwimmingStyles style, TimeSpan time)
249 {
250 PersonStart start = GetStartByStyle(style);
251 if (start == null) { return; }
252 start.Time = time;
253 }
254
255 #endregion
256
257 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
258
259 #region Properties derived from the starts
260
264 [FileServiceIgnore]
265 public PersonStart HighestScoreStart => Starts?.Values?.Where(s => s != null && s.IsActive)?.OrderByDescending(s => s.Score).FirstOrDefault();
266
270 [FileServiceIgnore]
271 public double HighestScore => HighestScoreStart?.Score ?? 0;
272
276 [FileServiceIgnore]
278
282 [FileServiceIgnore]
284
289 [FileServiceIgnore]
290 public bool IsActive
291 {
292 get => Starts?.Values?.Where(s => s != null)?.Any(s => s.IsActive) ?? false;
293 set
294 {
295 if (Starts == null) { return; }
296 Starts?.Values?.Where(s => s != null)?.ToList()?.ForEach(s => s.IsActive = value);
297 OnPropertyChanged(nameof(IsActive));
298 }
299 }
300
301 #endregion
302
303 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
304
305 #region Other properties
306
307 private bool _hasDuplicates = false;
312 [FileServiceIgnore]
313 public bool HasDuplicates
314 {
315 get => _hasDuplicates;
316 set => SetProperty(ref _hasDuplicates, value);
317 }
318
319 private int _resultListPlace = 0;
324 [FileServiceIgnore]
326 {
327 get => _resultListPlace;
328 set => SetProperty(ref _resultListPlace, value);
329 }
330
331 #endregion
332
333 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
334
335 #region PersonStart PropertyChanged event handler
336
337 private void PersonStart_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
338 {
339 OnPropertyChanged(nameof(Starts));
340 OnPropertyChanged(nameof(HighestScore));
341 OnPropertyChanged(nameof(HighestScoreStyle));
342 OnPropertyChanged(nameof(HighestScoreCompetition));
343 switch(e.PropertyName)
344 {
345 case nameof(PersonStart.IsActive):
346 OnPropertyChanged(nameof(IsActive));
347 break;
348 default: break;
349 }
350 }
351
352 #endregion
353
354 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
355
356 #region Style Properties for faster access and file saving
357
361 [FileServiceOrder]
362 public bool Breaststroke
363 {
364 get => GetStartByStyle(SwimmingStyles.Breaststroke) != null;
365 set { SetStartAvailable(SwimmingStyles.Breaststroke, value); OnPropertyChanged(); }
366 }
367
371 [FileServiceOrder]
372 public bool Freestyle
373 {
374 get => GetStartByStyle(SwimmingStyles.Freestyle) != null;
375 set { SetStartAvailable(SwimmingStyles.Freestyle, value); OnPropertyChanged(); }
376 }
377
381 [FileServiceOrder]
382 public bool Backstroke
383 {
384 get => GetStartByStyle(SwimmingStyles.Backstroke) != null;
385 set { SetStartAvailable(SwimmingStyles.Backstroke, value); OnPropertyChanged(); }
386 }
387
391 [FileServiceOrder]
392 public bool Butterfly
393 {
394 get => GetStartByStyle(SwimmingStyles.Butterfly) != null;
395 set { SetStartAvailable(SwimmingStyles.Butterfly, value); OnPropertyChanged(); }
396 }
397
401 [FileServiceOrder]
402 public bool Medley
403 {
404 get => GetStartByStyle(SwimmingStyles.Medley) != null;
405 set { SetStartAvailable(SwimmingStyles.Medley, value); OnPropertyChanged(); }
406 }
407
411 [FileServiceOrder]
412 public bool WaterFlea
413 {
414 get => GetStartByStyle(SwimmingStyles.WaterFlea) != null;
415 set { SetStartAvailable(SwimmingStyles.WaterFlea, value); OnPropertyChanged(); }
416 }
417
418 #endregion
419
420 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
421
422 #region Time Properties for faster access and file saving
423
427 [FileServiceOrder]
428 public TimeSpan BreaststrokeTime
429 {
430 get => GetStartByStyle(SwimmingStyles.Breaststroke)?.Time ?? new TimeSpan();
431 set { SetStartTime(SwimmingStyles.Breaststroke, value); OnPropertyChanged(); }
432 }
433
437 [FileServiceOrder]
438 public TimeSpan FreestyleTime
439 {
440 get => GetStartByStyle(SwimmingStyles.Freestyle)?.Time ?? new TimeSpan();
441 set { SetStartTime(SwimmingStyles.Freestyle, value); OnPropertyChanged(); }
442 }
443
447 [FileServiceOrder]
448 public TimeSpan BackstrokeTime
449 {
450 get => GetStartByStyle(SwimmingStyles.Backstroke)?.Time ?? new TimeSpan();
451 set { SetStartTime(SwimmingStyles.Backstroke, value); OnPropertyChanged(); }
452 }
453
457 [FileServiceOrder]
458 public TimeSpan ButterflyTime
459 {
460 get => GetStartByStyle(SwimmingStyles.Butterfly)?.Time ?? new TimeSpan();
461 set { SetStartTime(SwimmingStyles.Butterfly, value); OnPropertyChanged(); }
462 }
463
467 [FileServiceOrder]
468 public TimeSpan MedleyTime
469 {
470 get => GetStartByStyle(SwimmingStyles.Medley)?.Time ?? new TimeSpan();
471 set { SetStartTime(SwimmingStyles.Medley, value); OnPropertyChanged(); }
472 }
473
477 [FileServiceOrder]
478 public TimeSpan WaterFleaTime
479 {
480 get => GetStartByStyle(SwimmingStyles.WaterFlea)?.Time ?? new TimeSpan();
481 set { SetStartTime(SwimmingStyles.WaterFlea, value); OnPropertyChanged(); }
482 }
483
484 #endregion
485
486 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
487
488 #region Friendship properties
489
490 private ObservableCollection<int> _friendGroupIDs = new ObservableCollection<int>();
495 [FileServiceOrder]
496 public ObservableCollection<int> FriendGroupIDs
497 {
498 get => _friendGroupIDs;
499 set
500 {
501 if (_friendGroupIDs != null) { _friendGroupIDs.CollectionChanged -= _friendGroupIDs_CollectionChanged; }
502 if (SetProperty(ref _friendGroupIDs, value))
503 {
504 if (_friendGroupIDs != null)
505 {
506 _friendGroupIDs.Sort((a, b) => a.CompareTo(b));
507 _friendGroupIDs.CollectionChanged += _friendGroupIDs_CollectionChanged;
508 }
509 }
510 }
511 }
512
513 private void _friendGroupIDs_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
514 {
515 OnPropertyChanged(nameof(FriendGroupIDs));
516 }
517
518 private List<Person> _friends = new List<Person>();
523 [FileServiceIgnore]
524 public List<Person> Friends
525 {
526 get => _friends;
527 set => SetProperty(ref _friends, value);
528 }
529
530 #endregion
531
532 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
533
534 #region SetPropertyFromString helper
535
539 public const string START_INACTIVE_MARKER_STRING = "i";
540
547 public static void SetPropertyFromString(Person dataObj, string propertyName, string value)
548 {
549 if(string.IsNullOrEmpty(value)) return;
550
551 switch (propertyName)
552 {
553 case nameof(FirstName): dataObj.FirstName = value; break;
554 case nameof(Name): dataObj.Name = value; break;
555 case nameof(Gender): if (EnumCoreLocalizedStringHelper.TryParse(value, out Genders parsedGender)) { dataObj.Gender = parsedGender; } break;
556 case nameof(BirthYear): dataObj.BirthYear = UInt16.Parse(value); break;
557 case nameof(Breaststroke):
558 dataObj.Breaststroke = !string.IsNullOrEmpty(value);
559 if (dataObj.Starts[SwimmingStyles.Breaststroke] != null) { dataObj.Starts[SwimmingStyles.Breaststroke].IsActive = !value.Equals(START_INACTIVE_MARKER_STRING, StringComparison.OrdinalIgnoreCase); }
560 break;
561 case nameof(Freestyle):
562 dataObj.Freestyle = !string.IsNullOrEmpty(value);
563 if (dataObj.Starts[SwimmingStyles.Freestyle] != null) { dataObj.Starts[SwimmingStyles.Freestyle].IsActive = !value.Equals(START_INACTIVE_MARKER_STRING, StringComparison.OrdinalIgnoreCase); }
564 break;
565 case nameof(Backstroke):
566 dataObj.Backstroke = !string.IsNullOrEmpty(value);
567 if (dataObj.Starts[SwimmingStyles.Backstroke] != null) { dataObj.Starts[SwimmingStyles.Backstroke].IsActive = !value.Equals(START_INACTIVE_MARKER_STRING, StringComparison.OrdinalIgnoreCase); }
568 break;
569 case nameof(Butterfly):
570 dataObj.Butterfly = !string.IsNullOrEmpty(value);
571 if (dataObj.Starts[SwimmingStyles.Butterfly] != null) { dataObj.Starts[SwimmingStyles.Butterfly].IsActive = !value.Equals(START_INACTIVE_MARKER_STRING, StringComparison.OrdinalIgnoreCase); }
572 break;
573 case nameof(Medley):
574 dataObj.Medley = !string.IsNullOrEmpty(value);
575 if (dataObj.Starts[SwimmingStyles.Medley] != null) { dataObj.Starts[SwimmingStyles.Medley].IsActive = !value.Equals(START_INACTIVE_MARKER_STRING, StringComparison.OrdinalIgnoreCase); }
576 break;
577 case nameof(WaterFlea):
578 dataObj.WaterFlea = !string.IsNullOrEmpty(value);
579 if (dataObj.Starts[SwimmingStyles.WaterFlea] != null) { dataObj.Starts[SwimmingStyles.WaterFlea].IsActive = !value.Equals(START_INACTIVE_MARKER_STRING, StringComparison.OrdinalIgnoreCase); }
580 break;
581 case nameof(BreaststrokeTime): dataObj.BreaststrokeTime = TimeSpan.Parse(value); break;
582 case nameof(FreestyleTime): dataObj.FreestyleTime = TimeSpan.Parse(value); break;
583 case nameof(BackstrokeTime): dataObj.BackstrokeTime = TimeSpan.Parse(value); break;
584 case nameof(ButterflyTime): dataObj.ButterflyTime = TimeSpan.Parse(value); break;
585 case nameof(MedleyTime): dataObj.MedleyTime = TimeSpan.Parse(value); break;
586 case nameof(WaterFleaTime): dataObj.WaterFleaTime = TimeSpan.Parse(value); break;
587 case nameof(FriendGroupIDs): dataObj.FriendGroupIDs = new ObservableCollection<int>(value.Split(',').Select(s => int.Parse(s))); dataObj.FriendGroupIDs.Sort((a, b) => a.CompareTo(b)); break;
588 default: break;
589 }
590 }
591
592 #endregion
593
594 // +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
595
596 #region Equality, HashCode, ToString, Clone
597
603 public override bool Equals(object obj)
604 => obj is Person p && (p.Name.ToUpper(), p.FirstName.ToUpper(), p.Gender, p.BirthYear).Equals((Name.ToUpper(), FirstName.ToUpper(), Gender, BirthYear)) && p.FriendGroupIDs.SequenceEqual(FriendGroupIDs) && CompareDictionaries(Starts, p.Starts);
605
611 public bool Equals(Person other)
612 => Equals((object)other);
613
620 public override int GetHashCode()
621 => base.GetHashCode();
622 //=> (Name.ToUpper(), FirstName.ToUpper(), Gender, BirthYear, FriendGroupIDs, Starts).GetHashCode();
623
628 public override string ToString()
629 => Name + ", " + FirstName + " (" + BirthYear.ToString() + ")";
630
635 public object Clone()
636 => new Person(this);
637
647 private bool CompareDictionaries<TKey, TValue>(Dictionary<TKey, TValue> dict1, Dictionary<TKey, TValue> dict2)
648 {
649 if (dict1 == dict2) return true;
650 if ((dict1 == null) || (dict2 == null)) return false;
651 if (dict1.Count != dict2.Count) return false;
652
653 EqualityComparer<TValue> valueComparer = EqualityComparer<TValue>.Default;
654
655 foreach (KeyValuePair<TKey, TValue> kvp in dict1)
656 {
657 TValue value2;
658 if (!dict2.TryGetValue(kvp.Key, out value2)) return false;
659 if (!valueComparer.Equals(kvp.Value, value2)) return false;
660 }
661 return true;
662 }
663
664 #endregion
665 }
666}
Class describing a competition.
double HighestScore
This is score of the start in the Starts dictionary with the highest score value.
Definition Person.cs:271
Competition HighestScoreCompetition
This is the competition of the start in the Starts dictionary for which the highest score value was r...
Definition Person.cs:283
string FirstName
First name of the person.
Definition Person.cs:77
bool Breaststroke
Starting with Breaststroke.
Definition Person.cs:363
override bool Equals(object obj)
Compare if two Persons are equal.
Dictionary< SwimmingStyles, int > AvailableCompetitionsIDs
Get the competition IDs for the AvailableCompetitions (-1 = when Competition is null)
Definition Person.cs:149
TimeSpan ButterflyTime
Time for Butterfly.
Definition Person.cs:459
TimeSpan WaterFleaTime
Time for WaterFlea.
Definition Person.cs:479
Person(Person other)
Clone constructor for a Person object.
Definition Person.cs:38
void SetStartAvailable(SwimmingStyles style, bool available)
Set the flag if the start is available.
Definition Person.cs:227
bool HasStarts
True if at least one of the starts in the Starts dictionary is not null.
Definition Person.cs:210
void SetStartTime(SwimmingStyles style, TimeSpan time)
Set the time for the matching start if available.
Definition Person.cs:248
ObservableCollection< int > FriendGroupIDs
IDs of the friend groups the person belongs to.
Definition Person.cs:497
TimeSpan FreestyleTime
Time for Freestyle.
Definition Person.cs:439
PersonStart GetStartByStyle(SwimmingStyles style)
Get the first start in the list of starts of the person that matches the style.
Definition Person.cs:217
TimeSpan MedleyTime
Time for Medley.
Definition Person.cs:469
bool WaterFlea
Starting with WaterFlea.
Definition Person.cs:413
const string START_INACTIVE_MARKER_STRING
String used to mark a start as inactive in the file (case-insensitive)
Definition Person.cs:539
Dictionary< SwimmingStyles, bool > IsUsingMaxAgeCompetitionDict
Dictionary with flags if the max age competition will be used for the person and the style.
Definition Person.cs:167
Dictionary< SwimmingStyles, bool > IsUsingExactAgeCompetitionDict
Dictionary with flags if the exact age competition will be used for the person and the style.
Definition Person.cs:178
Dictionary< SwimmingStyles, Competition > AvailableCompetitions
Dictionary with all available Competition of the person.
Definition Person.cs:116
bool Equals(Person other)
Indicates wheather the current object is equal to another object of the same type.
Dictionary< SwimmingStyles, bool > AvailableCompetitionsFlags
Representation for the AvailableCompetitions as boolean flags (true = when competition is available,...
Definition Person.cs:132
List< Person > Friends
Friends of the person.
Definition Person.cs:525
UInt16 BirthYear
Birth year of the person.
Definition Person.cs:99
Dictionary< SwimmingStyles, PersonStart > _availableStartsDict
This dictionary holds all available starts of the person (no matter if assigned or not).
Definition Person.cs:193
TimeSpan BreaststrokeTime
Time for Breaststroke.
Definition Person.cs:429
TimeSpan BackstrokeTime
Time for Backstroke.
Definition Person.cs:449
bool HasDuplicates
This flag indicates if there are duplicates of this in the person list.
Definition Person.cs:314
bool Butterfly
Starting with Butterfly.
Definition Person.cs:393
Person()
Constructor for a new Person object.
Definition Person.cs:18
string Name
Last name of the person.
Definition Person.cs:66
PersonStart HighestScoreStart
This is the start in the Starts dictionary with the highest score value.
Definition Person.cs:265
Genders Gender
Gender of the person.
Definition Person.cs:88
bool Backstroke
Starting with Backstroke.
Definition Person.cs:383
bool IsActive
Check if at least one of the starts in the Starts dictionary is active.
Definition Person.cs:291
object Clone()
Create a new object that has the same property values than this one.
Dictionary< SwimmingStyles, PersonStart > Starts
Dictionary with all starts of the person.
Definition Person.cs:201
static void SetPropertyFromString(Person dataObj, string propertyName, string value)
Set the requested property in the Person object by parsing the given string value.
Definition Person.cs:547
override string ToString()
Returns a string that represents the current object.
SwimmingStyles HighestScoreStyle
This is the style of the start in the Starts dictionary for which the highest score value was reached...
Definition Person.cs:277
override int GetHashCode()
Serves as the default hash function.
bool Freestyle
Starting with Freestyle.
Definition Person.cs:373
bool CompareDictionaries< TKey, TValue >(Dictionary< TKey, TValue > dict1, Dictionary< TKey, TValue > dict2)
Compare if two dictionaries are equal (same keys and same values)
Definition Person.cs:647
bool Medley
Starting with Medley.
Definition Person.cs:403
int ResultListPlace
This is the place in the overall result list of the person.
Definition Person.cs:326
Class describing a start of a person.
Definition PersonStart.cs:9
TimeSpan Time
Time the person needed during the race of this start.
SwimmingStyles
Available swimming styles.
Genders
Available genders for a person.
Definition Genders.cs:7