26 lines
649 B
C#
26 lines
649 B
C#
using GameIdeas.Shared.Dto;
|
|
|
|
namespace GameIdeas.BlazorApp.Helpers;
|
|
|
|
public static class GameHelper
|
|
{
|
|
public static void WriteTrackingDto(GameDto game)
|
|
{
|
|
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",
|
|
};
|
|
}
|
|
}
|