private Dice GetDiceMock() { var realDice = new YoloDice(); var diceMock = A.Fake <Dice>(); A.CallTo(() => diceMock.RollK100()).Returns(realDice.RollK100()); A.CallTo(() => diceMock.RollBetween(A <int> .Ignored, A <int> .Ignored)) .ReturnsLazily((int low, int high) => realDice.RollBetween(low, high)); A.CallTo(() => diceMock.RollChance(A <int> .Ignored)).ReturnsLazily((int chance) => realDice.RollChance(chance)); A.CallTo(() => diceMock.RollPosition(A <int> .Ignored, A <int> .Ignored)) .ReturnsLazily((int width, int height) => realDice.RollPosition(width, height)); return(diceMock); }
public Monster(string name, Position position) { Name = name; Position = position; Hitpoints = new YoloDice().RollForHitpoints(MinHitpoints, MaxHitpoints); }
public Map() { _yoloDice = new YoloDice(); Rooms = new List <Room>(); }