js/GameManager.js
/*************************
 * Game Manager          *
 * Manages the game list *
 *************************/
Game Manager
Manages the game list
Game Manager Manages the game list
function GameManager() {
  this.games = [];
  this.sourcepaths = CONFIG.gamepaths;
  this.dirs = [];
  for (var i = 0; i < this.sourcepaths.length; i++) {
    this.dirs[i] = GetDirectoryList(this.sourcepaths[i]);
    if (this.dirs[i] != undefined) {
      for (var j in this.dirs[i]) {
        if (fs.existsSync(this.sourcepaths[i]+"/"+this.dirs[i][j]+"/"+"game.sgm")) { 
          this.games.push( new Game(this.dirs[i][j], this.sourcepaths[i]) );
        }
      }
    }
  }
  this.listGames = function() {
    var list = "";
    for (var i in game_manager.games) {
      list += game_manager.games[i].getHTML();
    }
    return list;
  }
}
function GameManager ( ) { this . games = [ ] ; this . sourcepaths = CONFIG . gamepaths ; this . dirs = [ ] ; for ( var i = 0 ; i < this . sourcepaths . length ; i ++ ) { this . dirs [ i ] = GetDirectoryList ( this . sourcepaths [ i ] ) ; if ( this . dirs [ i ] != undefined ) { for ( var j in this . dirs [ i ] ) { if ( fs . existsSync ( this . sourcepaths [ i ] + "/" + this . dirs [ i ] [ j ] + "/" + "game.sgm" ) ) { this . games . push ( new Game ( this . dirs [ i ] [ j ] , this . sourcepaths [ i ] ) ) ; } } } } this . listGames = function ( ) { var list = "" ; for ( var i in game_manager . games ) { list += game_manager . games [ i ] . getHTML ( ) ; } return list ; } }
Game Manager
 Manages the game list
Game Manager Manages the game list
//Iterate through all given game paths //Add games to list //Only if it's a project dir //End (if dirs[i] != undefined) /** List games as HTML output */