示例#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);
 }