Beispiel #1
0
 public MazeGridGenerator(
     IMazeLoader mazeLoader,
     IMazeValidator mazeValidator,
     IMazePositionFinder mazePositionFinder)
 {
     this.mazeLoader         = mazeLoader.CheckIfNull(nameof(mazeLoader));
     this.mazeValidator      = mazeValidator.CheckIfNull(nameof(mazeValidator));
     this.mazePositionFinder = mazePositionFinder.CheckIfNull(nameof(mazePositionFinder));
 }
        public void Init()
        {
            string mazeFileName = "ExampleMaze.txt";

            this.mazeLoader         = new MazeFileLoader(mazeFileName);
            this.mazeValidtor       = new MazeValidator();
            this.mazePositionFinder = new MazePositionFinder();
            this.mazeGridGenerator  = new MazeGridGenerator(mazeLoader, mazeValidtor, mazePositionFinder);
            this.maze = new core.Maze(mazeGridGenerator);
        }
Beispiel #3
0
        /// <summary>
        /// Load data from an external source
        /// </summary>
        /// <param name="loader"></param>
        public void Load(IMazeLoader loader)
        {
            if (loader == null)
            {
                throw new ArgumentNullException("loader", "Loader cannot be null");
            }


            _logger.LogInformation($"Loading Data Using: {loader.GetType().Name}");

            loader.Load(this);
        }
Beispiel #4
0
        public void Init()
        {
            string mazeFileName = "ExampleMazeSmall.txt";

            this.mazeLoader         = new MazeFileLoader(mazeFileName);
            this.mazeValidtor       = new MazeValidator();
            this.mazePositionFinder = new MazePositionFinder();
            this.mazeGridGenerator  = new MazeGridGenerator(mazeLoader, mazeValidtor, mazePositionFinder);
            this.maze             = new core.Maze(mazeGridGenerator);
            this.explorerPosition = new ExplorerPosition();
            this.movementAnalyser = new MovementAnalyser(this.explorerPosition, this.maze);
            this.moveHandler      = new MoveHandler(this.explorerPosition);
            this.explorer         = new Explorer(this.maze, this.movementAnalyser, this.moveHandler);
        }