Exemple #1
0
        public void ComputeNextRoomId_2X2SizeStartRoom1DirectionE_ExpectResultMinus1()
        {
            var  roomId    = 1;
            char direction = 'e';
            var  mazeSize  = 2;

            var result = RoomUtil.ComputeNextRoomId(roomId, direction, mazeSize);

            Assert.AreEqual(result, -1);
        }
        public int?GetRoom(int roomId, char direction)
        {
            var searchedRoomId = RoomUtil.ComputeNextRoomId(roomId, direction, _connectToMaze.GetMazeMapInstance().mazeSize);

            var room = _connectToMaze.GetMazeMapInstance().mazeRooms.Where(r => r.Id == searchedRoomId).FirstOrDefault();

            if (room != null)
            {
                return(room.Id);
            }

            return(null);
        }