<commit_before>angular.module( 'ngBoilerplate.home', [
  'ui.router',
  'direcitve.diGameBoard',
  'service.GameManager',
  'service.animframePolyFill',
  'service.Keyboard'
])
.config(function config( $stateProvider ) {
  $stateProvider.state( 'home', {
    url: '/home',
    views: {
      "main": {
        controller: 'HomeCtrl',
        templateUrl: 'home/home.tpl.html'
      }
    },
    data:{ pageTitle: 'Home' }
  });
})
.controller('HomeCtrl', [
    '$scope',
    'GameManager',
    'animframePolyFill',
    'KeyboardService',
function HomeController(
    $scope,
    GameManager,
    animframePolyFill,
    KeyboardService
){
    function gameLoop() {
        GameManager.moveCurrentPiece();
        if(!$scope.$$phase) {
            $scope.$apply();
        }
    }

    var loop = _.throttle(gameLoop, 2000, {
            leading: false,
            trailing: false
        });
    $scope.gameOn = function gameOn() {
        var self = this;
        window.requestAnimationFrame(function () {
            self.gameOn();
        });
        if(!GameManager.isPause() && GameManager.isGameStart()) {
            loop();
            $scope.$broadcast('GameOn');
        }
    };

    $scope.newGame = function newGame() {
        KeyboardService.init();
        GameManager.newGame();
    };

    $scope.startNewGame = function startNewGame() {
        GameManager.setGameStart();
        KeyboardService.on(function(key) {
            GameManager.move(key);
        });
        $scope.gameOn();
    };

    $scope.isGameStart = function isGameStart() {
        return GameManager.isGameStart();
    };

    $scope.pauseGame = function pauseGame() {
        GameManager.setPause();
    };

    $scope.isPause = function isPause() {
        return GameManager.isPause();
    };

    $scope.continueGame = function continueGame() {
        GameManager.setPause();
    };

    $scope.newGame();
}]);<commit_msg>add return this and add getScore function to display current score<commit_after>angular.module( 'ngBoilerplate.home', [
  'ui.router',
  'direcitve.diGameBoard',
  'service.GameManager',
  'service.animframePolyFill',
  'service.Keyboard'
])
.config(function config( $stateProvider ) {
  $stateProvider.state( 'home', {
    url: '/home',
    views: {
      "main": {
        controller: 'HomeCtrl',
        templateUrl: 'home/home.tpl.html'
      }
    },
    data:{ pageTitle: 'Home' }
  });
})
.controller('HomeCtrl', [
    '$scope',
    'GameManager',
    'animframePolyFill',
    'KeyboardService',
function HomeController(
    $scope,
    GameManager,
    animframePolyFill,
    KeyboardService
){
    function gameLoop() {
        GameManager.moveCurrentPiece();
        if(!$scope.$$phase) {
            $scope.$apply();
        }
    }

    var loop = _.throttle(gameLoop, 2000, {
            leading: false,
            trailing: false
        });
    $scope.gameOn = function gameOn() {
        var self = this;
        window.requestAnimationFrame(function () {
            self.gameOn();
        });
        if(!GameManager.isPause() && GameManager.isGameStart()) {
            loop();
            $scope.$broadcast('GameOn');
        }
    };

    $scope.newGame = function newGame() {
        KeyboardService.init();
        GameManager.newGame();
        return this;
    };

    $scope.startNewGame = function startNewGame() {
        GameManager.setGameStart();
        KeyboardService.on(function(key) {
            GameManager.move(key);
        });
        $scope.gameOn();
        return this;
    };

    $scope.isGameStart = function isGameStart() {
        return GameManager.isGameStart();
    };

    $scope.pauseGame = function pauseGame() {
        GameManager.setPause();
        return this;
    };

    $scope.isPause = function isPause() {
        return GameManager.isPause();
    };

    $scope.continueGame = function continueGame() {
        GameManager.setPause();
        return this;
    };

    $scope.getScore = function getScore() {
        return GameManager.getScore();
    };

    $scope.newGame();
}]);
{'fraction_non_alphanumeric': 0.1455260570304818, 'fraction_numerical': 0.0019665683382497543, 'mean_word_length': 2.24481658692185, 'pattern_counts': {'":': 2, '<': 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': '4471767', 'n_tokens_mistral': 1236, 'n_tokens_neox': 1214, 'n_words': 203}