public Coordinate GetExit()
 {
     string[] exitConfig = _textFileRepository.GetConfigDataRow(3).Split(" ");
     return(new Coordinate()
     {
         X = Convert.ToInt32(exitConfig[0]), Y = Convert.ToInt32(exitConfig[1])
     });
 }
 public Board GetBoard()
 {
     string[] boardSizeConfig = _textFileRepository.GetConfigDataRow(1).Split(" ");
     return(new Board()
     {
         Width = Convert.ToInt32(boardSizeConfig[0]), Height = Convert.ToInt32(boardSizeConfig[1])
     });
 }
Example #3
0
        public Player GetPlayer()
        {
            string[] initialPositionConfig = _textFileRepository.GetConfigDataRow(4).Split(" ");
            int      initialX = Convert.ToInt32(initialPositionConfig[0]);
            int      InitialY = Convert.ToInt32(initialPositionConfig[1]);

            Direction initialDirection = (Direction)Enum.Parse(typeof(Direction), initialPositionConfig[2]);

            return(new Player()
            {
                Direction = initialDirection,
                Position = new Coordinate()
                {
                    X = initialX, Y = InitialY
                }
            });
        }