예제 #1
0
파일: Explorer.cs 프로젝트: virdijag/Maze
 public Explorer(
     IMaze maze,
     IMovementAnalyser movementAnalyser,
     IMoveHandler moveHandler)
 {
     this.maze             = maze.CheckIfNull(nameof(maze));
     this.movementAnalyser = movementAnalyser.CheckIfNull(nameof(movementAnalyser));
     this.moveHandler      = moveHandler.CheckIfNull(nameof(moveHandler));
     this.Facing           = Facing.East;
     this.recordedMoves    = new List <string>();
 }
예제 #2
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);
        }
예제 #3
0
 public void Init()
 {
     this.explorerPositionMock = new Mock <IExplorerPosition>();
     this.mazeMock             = new Mock <IMaze>();
     this.movementAnalyser     = new MovementAnalyser(this.explorerPositionMock.Object, this.mazeMock.Object);
 }