hotfixes - so we can at least run it #9
|
@ -7,8 +7,15 @@ public class GameController {
|
||||||
|
|
||||||
public void startLocalGame(Class<? extends LocalPlayer> localPlayerClass, Class<? extends AiPlayer> enemyClass, int size) throws InstantiationException, IllegalAccessException {
|
public void startLocalGame(Class<? extends LocalPlayer> localPlayerClass, Class<? extends AiPlayer> enemyClass, int size) throws InstantiationException, IllegalAccessException {
|
||||||
|
|
||||||
LocalPlayer localPlayer = localPlayerClass.newInstance();
|
LocalPlayer localPlayer;
|
||||||
AiPlayer aiPlayer = enemyClass.newInstance();
|
AiPlayer aiPlayer;
|
||||||
|
try {
|
||||||
|
localPlayer = localPlayerClass.getDeclaredConstructor().newInstance();
|
||||||
|
aiPlayer = enemyClass.getDeclaredConstructor().newInstance();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return;
|
||||||
|
}
|
||||||
localPlayer.setEnemy(aiPlayer);
|
localPlayer.setEnemy(aiPlayer);
|
||||||
aiPlayer.setEnemy(localPlayer);
|
aiPlayer.setEnemy(localPlayer);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue