コード例 #1
0
        private void Move(Direction direction, IDynamic agent, Game game)
        {
            switch (direction)
            {
            case Direction.Up:
                agent.Move(0, -1);
                break;

            case Direction.Down:
                agent.Move(0, 1);
                break;

            case Direction.Left:
                agent.Move(-1, 0);
                break;

            case Direction.Right:
                agent.Move(1, 0);
                break;
            }
            game.UnPause();
        }