public int GetTakenPlace(int value) {
switch (Type) {
case PlaceConditionsType.Points:
return FirstPlaceTarget.HasValue && value >= FirstPlaceTarget ? 1 :
SecondPlaceTarget.HasValue && value >= SecondPlaceTarget ? 2 :
ThirdPlaceTarget.HasValue && value >= ThirdPlaceTarget ? 3 :
UnremarkablePlace;
case PlaceConditionsType.Position:
case PlaceConditionsType.Time:
return FirstPlaceTarget.HasValue && value <= FirstPlaceTarget ? 1 :
SecondPlaceTarget.HasValue && value <= SecondPlaceTarget ? 2 :
ThirdPlaceTarget.HasValue && value <= ThirdPlaceTarget ? 3 :
UnremarkablePlace;
default:
throw new ArgumentOutOfRangeException();
}
}