MCPcopy Create free account
hub / github.com/demoth/jake2 / createGameModInstance

Method createGameModInstance

server/src/main/java/jake2/server/SV_MAIN.java:1105–1116  ·  view source on GitHub ↗

Find and create an instance of the game subsystem

(GameImportsImpl gameImports)

Source from the content-addressed store, hash-verified

1103 * Find and create an instance of the game subsystem
1104 */
1105 private static GameExports createGameModInstance(GameImportsImpl gameImports) {
1106 // todo: introduce proper Dependency Injection
1107 try {
1108 Class<?> game = Class.forName("jake2.game.GameExportsImpl");
1109 Constructor<?> constructor = game.getConstructor(GameImports.class);
1110 return (GameExports) constructor.newInstance(gameImports);
1111 } catch (Exception e) {
1112 e.printStackTrace();
1113 Com.Error(ERR_FATAL, "Could not initialise game subsystem due to : " + e.getMessage() + "\n");
1114 return null;
1115 }
1116 }
1117
1118 void SV_Loadgame_f(List<String> args) {
1119

Callers 1

createGameInstanceMethod · 0.95

Calls 1

ErrorMethod · 0.95

Tested by

no test coverage detected