DiceService.cs 411 B

1234567891011121314151617181920
  1. namespace Infrastructure;
  2. public static class DiceService
  3. {
  4. public static Random Random = new();
  5. public static int Bonus(int statValue)
  6. {
  7. return Utilities.Round(statValue, 10);
  8. }
  9. public static int RollDices(int numberOfRoll, int diceValue)
  10. {
  11. var sum = 0;
  12. for (var i = 0; i < numberOfRoll; i++) sum += Random.Next(1, diceValue);
  13. return sum;
  14. }
  15. }