コード例 #1
0
 private string Roulette(string username, int points, DatabaseContext context)
 {
     if (new Random().Next() % 100 < 30)
     {
         context.AddPointsToUser(username, points);
         User user = context.GetUserByName(username);
         return($"{username} won, now he has {user.Points} points");
     }
     else
     {
         context.AddPointsToUser(username, points * -1);
         User user = context.GetUserByName(username);
         return($"{username} lost, now he has {user.Points} points");
     }
 }