<commit_before>'use strict';
app.controller('MainCtrl', function ($scope, geotracker, geomath, places, mapping) {
        $scope.state = 'Initializing';

        /**
         * constructor
         */
        $scope.init = function() {
            geotracker.start();
        }

        /**
         * initialize golf green around user's location
         */
        $scope.initializeGreen = function() {
            $scope.state = 'Initializing';
            mapping.create();
            mapping.addMarker('me', 'me');
            places.search(500, $scope.onPlaces);
        }

        $scope.findBall = function() {
            mapping.animateCameraTo($scope.ball.coords, {animation: 'arc', returnToOriginal: true}, function() {
                console.log('done')
            });
        }

        /**
         * swing golf club
         */
        $scope.swing = function() {
            if (!$scope.ball) {
                $scope.ball = mapping.addMarker('ball', 'ball');
            }

            $scope.state = 'animating';
            mapping.animateMarkerBy(
                $scope.ball, $scope.power,
                $scope.direction, {animation: 'arc'}, function() {
                    $scope.state = 'GamePlay';
                    $scope.ball.distanceTo = geomath.calculateDistance(geotracker.geo.coords, $scope.ball.coords);
                    $scope.ball.bearingTo = geomath.calculateBearing(geotracker.geo.coords, $scope.ball.coords) -90;
                    $scope.$apply();
                });
        }

        /**
         * on place retrieval
         */
        $scope.onPlaces = function() {
            $scope.state = 'GamePlay';
            var hole = places.getFarthest();
            mapping.addMarker('loc', hole.name, hole.location);
            $scope.$apply();
        }

        /** call c-tor */
        $scope.init();
  });<commit_msg>hide game controls when animating to find ball<commit_after>'use strict';
app.controller('MainCtrl', function ($scope, geotracker, geomath, places, mapping) {
        $scope.state = 'Initializing';

        /**
         * constructor
         */
        $scope.init = function() {
            geotracker.start();
        }

        /**
         * initialize golf green around user's location
         */
        $scope.initializeGreen = function() {
            $scope.state = 'Initializing';
            mapping.create();
            mapping.addMarker('me', 'me');
            places.search(500, $scope.onPlaces);
        }

        $scope.findBall = function() {
            $scope.state = 'Animating';
            mapping.animateCameraTo($scope.ball.coords, {animation: 'arc', returnToOriginal: true}, function() {
                $scope.state = 'GamePlay';
            });
        }

        /**
         * swing golf club
         */
        $scope.swing = function() {
            if (!$scope.ball) {
                $scope.ball = mapping.addMarker('ball', 'ball');
            }

            $scope.state = 'Animating';
            mapping.animateMarkerBy(
                $scope.ball, $scope.power,
                $scope.direction, {animation: 'arc'}, function() {
                    $scope.state = 'GamePlay';
                    $scope.ball.distanceTo = geomath.calculateDistance(geotracker.geo.coords, $scope.ball.coords);
                    $scope.ball.bearingTo = geomath.calculateBearing(geotracker.geo.coords, $scope.ball.coords) -90;
                    $scope.$apply();
                });
        }

        /**
         * on place retrieval
         */
        $scope.onPlaces = function() {
            $scope.state = 'GamePlay';
            var hole = places.getFarthest();
            mapping.addMarker('loc', hole.name, hole.location);
            $scope.$apply();
        }

        /** call c-tor */
        $scope.init();
  });
{'fraction_non_alphanumeric': 0.14274530271398747, 'fraction_numerical': 0.0026096033402922755, 'mean_word_length': 1.5217105263157895, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4098689', 'n_tokens_mistral': 1071, 'n_tokens_neox': 1016, 'n_words': 180}