Conversation
b6f9c5a to
fcde2aa
Compare
|
The why and how in the PR description looks like it's been copied from another PR :-) |
... before drawing the winner
fcde2aa to
fb5b412
Compare
| <value>Athlete</value> | ||
| </data> | ||
| <data name="TicketsBase" xml:space="preserve"> | ||
| <value>Base</value> |
There was a problem hiding this comment.
Could this be called "Tickets" instead?
| <value>Base</value> | |
| <value>Tickets</value> |
| <value>Utøver</value> | ||
| </data> | ||
| <data name="TicketsBase" xml:space="preserve"> | ||
| <value>Base</value> |
There was a problem hiding this comment.
Same here.
| <value>Base</value> | |
| <value>Lodd</value> |
| { | ||
| private readonly Subject<FeedUpdate<Challenge>> _challengeFeed = new(); | ||
|
|
||
| public readonly int ExtraTicketsWhenGoalReached = 10; |
There was a problem hiding this comment.
I think it's fine that we keep this a constant for now, but perhaps we should make it configurable as part of the challenge at some point? Long running challenges, or hard individual goals probably deserves more bonus points 🙂
| baseTickets += (int)(activity.Details.DistanceInMeters / 1000); // 1 km = 1 ticket | ||
| break; | ||
| case ChallengeMeasurement.Elevation: | ||
| baseTickets += (int)activity.Details.TotalElevationGain; // 1 m = 1 ticket |
There was a problem hiding this comment.
I wonder if we should take the opportunity to adjust these measurements? It seems a bit strange that 1 meter elevation equals 1 km distance or 30 minutes duration..
It doesn't really matter as all athletes are compared by the same measure, but it will perhaps look a bit strange now that we get the tickets presented to us.
This is my initial suggestion, but please feel free to come with your opinion:
One tickets is granted for each:
- 100 meters distance
- 10 meters elevation
- 1 minute duration
- 10 kilocalories
|
|
||
| public readonly int ExtraTicketsWhenGoalReached = 10; | ||
|
|
||
| private List<AthleteTickets> BuildChallengeTickets(Challenge challenge) |
There was a problem hiding this comment.
It would be great if this parameter could be called challengeWithAthleteActivities to be explicit about it's need for having the activities be populated. It's not perfect, but it's just a private method, and it might help the next developer know what this method expects.
An alternative would be to make the query inside this method and just pass it the challenge ID, but then you'd have to either return the challenge object or have to make a duplicated query in DrawChallengeWinnerAsync.
WHAT
Show earned tickets and bonus tickets before spinning the lottery.

WHY
If an individual goal is set for a competition, we will show the bonus tickets for they who have reached the goal
HOW
Show bonus tickets before drawing winner