Skip to content

Commit

Permalink
fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
ezraroi committed Sep 20, 2024
1 parent cd33104 commit ea3de6a
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
2 changes: 1 addition & 1 deletion Mundialito/Controllers/StatsController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ public async Task<ActionResult<StatsModel>> GetStats(string username)

private async Task<ActionResult<StatsModel>> CalcStats(MundialitoUser requestedUser, MundialitoUser loggedUser, IEnumerable<MundialitoUser> followees)
{
var games = (float)gamesRepository.GetGames().Count();
var games = (float)gamesRepository.GetGames().Where((game) => game.IsBetResolved()).Count();
var users = (float)userManager.Users.Count();
var bets = betsRepository.GetBets().Where((bet) => bet.IsResolved()).ToList();
var table = tableBuilder.GetTable(userManager.Users.Select((user) => new UserWithPointsModel(user)), bets, generalBetsRepository.GetGeneralBets());
Expand Down
14 changes: 7 additions & 7 deletions Mundialito/DAL/Games/GameExtensionMethods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,34 +2,34 @@

public static class GameExtensionMethods
{
public static Boolean IsOpen(this Game game)
public static bool IsOpen(this Game game)
{
return game.IsOpen(DateTime.UtcNow);
}

public static Boolean IsOpen(this Game game, DateTime now)
public static bool IsOpen(this Game game, DateTime now)
{
return now < game.CloseTime;
}

public static Boolean IsPendingUpdate(this Game game)
public static bool IsPendingUpdate(this Game game)
{
return game.IsPendingUpdate(DateTime.UtcNow);
}

public static Boolean IsPendingUpdate(this Game game, DateTime now)
public static bool IsPendingUpdate(this Game game, DateTime now)
{
if (game.IsOpen(now))
return false;
return game.HomeScore == null || game.AwayScore == null || game.CardsMark == null || game.CornersMark == null;
}

public static Boolean IsBetResolved(this Game game)
public static bool IsBetResolved(this Game game)
{
return game.IsBetResolved(DateTime.UtcNow);
}

public static Boolean IsBetResolved(this Game game, DateTime now)
public static bool IsBetResolved(this Game game, DateTime now)
{
return !game.IsOpen(now) && !game.IsPendingUpdate(now);
}
Expand All @@ -40,7 +40,7 @@ public static String Mark(this Game game)
return game.Mark(DateTime.UtcNow);
}

public static String Mark(this Game game, DateTime now)
public static string Mark(this Game game, DateTime now)
{
if (!game.IsOpen(now))
{
Expand Down

0 comments on commit ea3de6a

Please sign in to comment.