public World(int worldWidth = 0, int worldHeight = 0, IBattleLog battleLog = null) { if (Instance != null) { throw new InvalidOperationException("World class is a singleton and must not be constructed more than once!"); } Instance = this; BattleLog = battleLog; Random = new Random(); Enemies = new List <T>(); Width = worldWidth; Height = worldHeight; }
public void Setup() { var playerLogAMock = new Mock <IPlayerLog>(); // Setup property without setter // See: https://stackoverflow.com/a/4662991/12347616 playerLogAMock.SetupGet(log => log.Log).Returns(new List <string>()); playerLogA = playerLogAMock.Object; var playerLogBMock = new Mock <IPlayerLog>(); playerLogBMock.SetupGet(log => log.Log).Returns(new List <string>()); playerLogB = playerLogBMock.Object; var battleLogMock = new Mock <IBattleLog>(); battleLogMock.Setup(log => log.GetLog()).Returns(new Dictionary <string, object>()); battleLog = battleLogMock.Object; }
public Battle(IPlayer playerA, IPlayer playerB, IBattleLog log) { this.playerA = playerA; this.playerB = playerB; this.log = log; }
public override void Activate() { _log = Model.BattleModel.BattleLog; _root = RConsole.RootConsole; _log.ClearLog(); }