Sha256: 357c2ca92aa94e0afdb461c96dfd3a79201982929f5b63df96ecc989aca63b4c

Contents?: true

Size: 1.15 KB

Versions: 56

Compression:

Stored size: 1.15 KB

Contents

////////////////////
//Multiplayer Games Interface Manager
////////////////////

PRESENCE.GAME.FACTORY = (function(P,$,undefined){
  
  //////////////////////////
  //        BUILDERS      //
  //////////////////////////
		
	var getGame = function(slug,choice){
		switch(choice){
		case "Modern-TER":
		  var options = new Array();
      options['theme']="Modern";
			return generateGame(slug,"TER",options)
		case "Classic-TER":
		  var options = new Array();
      options['theme']="Classic";
			return generateGame(slug,"TER",options)
		default:
		  return null
		}
	}
	
  var generateGame = function(guest_slug,gameId,options){
    var player1 = new PRESENCE.GAME.player(user_slug,user_name)
    var player2 = new PRESENCE.GAME.player(guest_slug,PRESENCE.XMPPClient.getNameFromSlug(guest_slug))
    var players = [player1,player2]
    var mygame = new PRESENCE.GAME.game(gameId,getGameName(gameId),players,options)
    return mygame;
  }

  var getGameName = function(gameId){
	  if (typeof PRESENCE.GAME[gameId].getName == "function") {
			return PRESENCE.GAME[gameId].getName();
	  } else {
			return gameId;
		}
	}


  return {
		getGame: getGame
  };

}) (PRESENCE, jQuery);

Version data entries

56 entries across 56 versions & 2 rubygems

Version Path
social_stream-2.2.2 presence/app/assets/javascripts/presence_game_factory.js.erb
social_stream-presence-2.2.1 app/assets/javascripts/presence_game_factory.js.erb
social_stream-2.2.1 presence/app/assets/javascripts/presence_game_factory.js.erb
social_stream-2.2.0 presence/app/assets/javascripts/presence_game_factory.js.erb
social_stream-presence-2.2.0 app/assets/javascripts/presence_game_factory.js.erb
social_stream-2.1.1 presence/app/assets/javascripts/presence_game_factory.js.erb
social_stream-1.1.12 presence/app/assets/javascripts/presence_game_factory.js.erb
social_stream-2.1.0 presence/app/assets/javascripts/presence_game_factory.js.erb
social_stream-presence-2.1.0 app/assets/javascripts/presence_game_factory.js.erb
social_stream-2.0.4 presence/app/assets/javascripts/presence_game_factory.js.erb
social_stream-presence-2.0.2 app/assets/javascripts/presence_game_factory.js.erb
social_stream-2.0.3 presence/app/assets/javascripts/presence_game_factory.js.erb
social_stream-1.1.11 presence/app/assets/javascripts/presence_game_factory.js.erb
social_stream-1.1.10 presence/app/assets/javascripts/presence_game_factory.js.erb
social_stream-1.1.9 presence/app/assets/javascripts/presence_game_factory.js.erb
social_stream-1.1.8 presence/app/assets/javascripts/presence_game_factory.js.erb
social_stream-2.0.2 presence/app/assets/javascripts/presence_game_factory.js.erb
social_stream-presence-2.0.1 app/assets/javascripts/presence_game_factory.js.erb
social_stream-2.0.1 presence/app/assets/javascripts/presence_game_factory.js.erb
social_stream-2.0.0 presence/app/assets/javascripts/presence_game_factory.js.erb