/*
* File : GameUtils.java
* Created : 27.12.2005
* By : kahless
*
* Gamer's Own Instant Messenger
* Copyright (C) 2005 Herbert Poul (kahless@sphene.net)
* http://goim.sphene.net
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 2 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA
*/
package net.sphene.goim.rcp.extensionpoints.game;
import java.util.List;
import net.sphene.goim.rcp.beans.GOIMGameList;
import net.sphene.goim.rcp.extensionpoints.GameExtensionPoint;
import net.sphene.goim.rcp.extensionpoints.IGame;
import net.sphene.goim.rcp.extensionpoints.IGameWithRegistryAutoDetection;
import net.sphene.goim.rcp.extensionpoints.GameExtensionPoint.GameExtensionProxy;
public class GameUtils {
public static void autodetectGames(GOIMGameList gameList) {
try {
List<GameExtensionProxy> gameExtensions = GameExtensionPoint.getGameExtensions();
for(GameExtensionProxy gameExtension : gameExtensions) {
IGame iGame = gameExtension.getDelegate();
if(iGame instanceof IGameWithRegistryAutoDetection) {
((IGameWithRegistryAutoDetection)iGame).autoDetect(gameExtension,gameList);
// if(item != null) {
// System.out.println("Auto detected game: " + item.toString());
// gameList.add(item);
// }
}
}
} catch(UnsatisfiedLinkError e) {
// Completely normal when running on linux platforms..
// but anyway .. print the exception ...
System.err.println("UnsatisfieldLinkError - If running on platforms other than win32 this only means that registry library is not available (ie. no problem)");
e.printStackTrace();
}
}
}