Display list of games (#16)
Co-authored-by: Maxime Adler <madler@sqli.com> Reviewed-on: #16
This commit was merged in pull request #16.
This commit is contained in:
@@ -9,4 +9,17 @@ public static class GameHelper
|
||||
game.CreationUserId = 100000;
|
||||
game.CreationDate = DateTime.Now;
|
||||
}
|
||||
|
||||
public static string GetInterestColor(int interest, int maxInterest)
|
||||
{
|
||||
int firstTier = (int)Math.Floor(0.33 * maxInterest);
|
||||
int secondTier = (int)Math.Ceiling(0.66 * maxInterest);
|
||||
|
||||
return interest switch
|
||||
{
|
||||
int x when x <= firstTier => "--red",
|
||||
int x when x >= secondTier => "--green",
|
||||
_ => "--yellow",
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user