implemented skill system according to designdocuments
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
using System;
|
||||
|
||||
namespace NightclubArcadia.Skills
|
||||
{
|
||||
public sealed class SeededRollSource : IRollSource
|
||||
{
|
||||
readonly Random _random;
|
||||
|
||||
public SeededRollSource(int seed)
|
||||
{
|
||||
_random = new Random(seed);
|
||||
}
|
||||
|
||||
public int Roll(int sides)
|
||||
{
|
||||
if (sides < 1)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException(nameof(sides));
|
||||
}
|
||||
|
||||
return _random.Next(1, sides + 1);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user