lua/wrappers/game/lua_game.cpp
/**
	 * Registers a game object with the game instance.
	 * 
	 * @param am.game_object game_object The game object to register with this game.
	 * @returns am.game This
	 */
Registers a game object with the game instance.

@param am.game_object game_object The game object to register with this game.
Registers a game object with the game instance . @param am . game_object game_object The game object to register with this game .
int Game_register_game_object(lua_State *lua)
	{
		Game *game = castUData<Game>(lua, 1);
		if (game)
		{
			GameObject *obj = getGameObject(lua, 2);
			if (obj)
			{
				if (!game->registerGameObject(obj))
				{
					std::stringstream ss;
					ss << "Unable to register game object: ";
					LuaState::printTypeValue(lua, 2, ss, true);
					ss << " (" << obj->getName() << " does not have a game id";
					LuaState::warning(lua, ss.str().c_str());
				}
				lua_first(lua);
			}
			return LuaState::expectedArgs(lua, "register_game_object", "am.game_object game_object");
		}
		return LuaState::expectedContext(lua, "register_game_object", "am.game");
	}
int Game_register_game_object ( lua_State * lua ) { Game * game = castUData < Game > ( lua , 1 ) ; if ( game ) { GameObject * obj = getGameObject ( lua , 2 ) ; if ( obj ) { if ( ! game -> registerGameObject ( obj ) ) { std :: stringstream ss ; ss << " " ; LuaState :: printTypeValue ( lua , 2 , ss , true ) ; ss << " " << obj -> getName ( ) << " " ; LuaState :: warning ( lua , ss . str ( ) . c_str ( ) ) ; } lua_first ( lua ) ; } return LuaState :: expectedArgs ( lua , " " , " " ) ; } return LuaState :: expectedContext ( lua , " " , " " ) ; }
Registers a game object with the game instance.
Registers a game object with the game instance .