mirror of
https://github.com/inf112-v20/Fiasko.git
synced 2025-02-07 18:49:34 +01:00
la til mulighet for manuell tester
This commit is contained in:
parent
4baba2b33a
commit
ae1f29cb34
@ -41,4 +41,6 @@ public interface RoboRallyUI {
|
||||
* @param shouldHurry True if the user should hurry
|
||||
*/
|
||||
void setShouldHurry(boolean shouldHurry);
|
||||
|
||||
boolean isTesting();
|
||||
}
|
||||
|
@ -20,6 +20,7 @@ public class RoboRallyWrapper extends Game implements RoboRallyUI {
|
||||
public RoboRallyServer server;
|
||||
public RoboRallyClient client;
|
||||
public boolean shouldHurry = false;
|
||||
public boolean isTesting = false;
|
||||
|
||||
@Override
|
||||
public void create() {
|
||||
@ -71,4 +72,9 @@ public class RoboRallyWrapper extends Game implements RoboRallyUI {
|
||||
public void quit() {
|
||||
Gdx.app.exit();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isTesting(){
|
||||
return this.isTesting;
|
||||
}
|
||||
}
|
||||
|
@ -59,6 +59,13 @@ public class LobbyScreen extends InteractiveScreen {
|
||||
|
||||
@Override
|
||||
public void touchUp(InputEvent event, float x, float y, int pointer, int button) {
|
||||
startGame();
|
||||
}
|
||||
});
|
||||
Gdx.input.setInputProcessor(stage);
|
||||
stage.setViewport(viewport);
|
||||
}
|
||||
private void startGame(){
|
||||
roboRallyWrapper.server.startGame();
|
||||
Map<Connection, String> playerNames = roboRallyWrapper.server.getPlayerNames();
|
||||
List<Player> playerList = IOUtil.playerGenerator(playerNames,
|
||||
@ -69,11 +76,6 @@ public class LobbyScreen extends InteractiveScreen {
|
||||
}
|
||||
roboRallyWrapper.setScreen(roboRallyWrapper.screenManager.getLoadingScreen(roboRallyWrapper));
|
||||
}
|
||||
});
|
||||
Gdx.input.setInputProcessor(stage);
|
||||
stage.setViewport(viewport);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void show() {
|
||||
super.show();
|
||||
@ -92,6 +94,13 @@ public class LobbyScreen extends InteractiveScreen {
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else if(keyCode == Input.Keys.T){
|
||||
roboRallyWrapper.isTesting=true;
|
||||
String testBoard = "Manuall_testing";
|
||||
selectBox.getItems().add(testBoard);
|
||||
selectBox.setSelected(testBoard);
|
||||
startGame();
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user