예제 #1
0
        public Engine()
        {
            scoreBoard      = new ScoreBoard();
            directionMapper = new DirectionMapper();
            gameStatus      = new GameStatus();

            // Hook up the input listener and set the event handler.
            inputListener             = new DirectionInputListener(directionMapper);
            inputListener.OnKeyPress += (source, e) => snek.Direction = e.Direction;
        }
예제 #2
0
        static void Main(string[] args)
        {
            Console.WriteLine("Which way do you want to go?");
            var input = Console.ReadLine();

            var directionMapper = new DirectionMapper();
            var direction       = directionMapper.GetDirection(input);

            direction.Drive();

            Console.ReadLine();
        }
예제 #3
0
 public void SetUp()
 {
     GivenTheRobotIsAt(1, 1);
     directionMapper = new DirectionMapper();
 }
예제 #4
0
 public DirectionCrudFactory() : base()
 {
     mapper = new DirectionMapper();
     dao    = SqlDao.GetInstance();
 }