Skip to content

Commit

Permalink
Merge pull request #38 from BellumGens/participant-points
Browse files Browse the repository at this point in the history
feat: adding points fallback
  • Loading branch information
kdinev authored Jan 23, 2025
2 parents d19af50 + 05f92d1 commit 9cf52be
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion BellumGens.Api.Core/Models/TournamentSC2Group.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@ public List<TournamentSC2Participant> PublicParticipants
_participants.Add(
new TournamentSC2Participant(
app.TournamentApplication,
Matches.Where(m => m.Player1Id == app.TournamentApplication.UserId || m.Player2Id == app.TournamentApplication.UserId).ToList()
Matches.Where(m => m.Player1Id == app.TournamentApplication.UserId || m.Player2Id == app.TournamentApplication.UserId).ToList(),
app.Points
)
);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@ namespace BellumGens.Api.Core.Models
{
public class TournamentSC2Participant : TournamentParticipant
{
public TournamentSC2Participant(TournamentApplication application, List<TournamentSC2Match> matches)
public TournamentSC2Participant(TournamentApplication application, List<TournamentSC2Match> matches, int points = 0)
: base(application)
{
BattleTag = application.BattleNetId;
Country = application.Country;
User = new UserInfoViewModel(application.User);
if (matches != null)
PlayerPoints = points;
if (PlayerPoints == 0 && matches != null)
{
foreach (TournamentSC2Match match in matches)
{
Expand Down

0 comments on commit 9cf52be

Please sign in to comment.