Splitter opp interfacer for tegning og intragering

Endrer ting slik at spillet får vite om server og klient ved initialisering
Registerer Action for kryo
Oppdaterer konstruktør i RoboRallyGameTest
This commit is contained in:
2020-04-16 10:03:52 +02:00
parent fa0d53524c
commit f46d2f4e29
11 changed files with 59 additions and 71 deletions

View File

@@ -6,13 +6,13 @@ import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import inf112.fiasko.roborally.networking.RoboRallyClient;
import inf112.fiasko.roborally.networking.RoboRallyServer;
import inf112.fiasko.roborally.objects.IDrawableGame;
import inf112.fiasko.roborally.objects.IRoboRallyGame;
public class RoboRallyWrapper extends Game {
public SpriteBatch batch;
public BitmapFont font;
public ScreenManager screenManager;
public IDrawableGame roboRallyGame;
public IRoboRallyGame roboRallyGame;
public RoboRallyServer server;
public RoboRallyClient client;

View File

@@ -14,8 +14,8 @@ import com.badlogic.gdx.utils.viewport.ExtendViewport;
import com.badlogic.gdx.utils.viewport.Viewport;
import inf112.fiasko.roborally.elementproperties.GameState;
import inf112.fiasko.roborally.gamewrapper.RoboRallyWrapper;
import inf112.fiasko.roborally.objects.IDrawableGame;
import inf112.fiasko.roborally.objects.IDrawableObject;
import inf112.fiasko.roborally.objects.IRoboRallyGame;
import inf112.fiasko.roborally.utility.IOUtil;
import inf112.fiasko.roborally.utility.TextureConverterUtil;
@@ -27,7 +27,7 @@ import java.util.List;
public class BoardActiveScreen extends AbstractScreen implements InputProcessor {
private final RoboRallyWrapper roboRallyWrapper;
private final OrthographicCamera camera;
private IDrawableGame debugGame;
private IRoboRallyGame debugGame;
private final int tileDimensions = 64;
private float cameraZoom = 1;
@@ -97,7 +97,7 @@ public class BoardActiveScreen extends AbstractScreen implements InputProcessor
@Override
public boolean keyUp(int keyCode) {
if (keyCode == Input.Keys.HOME) {
IDrawableGame temp = roboRallyWrapper.roboRallyGame;
IRoboRallyGame temp = roboRallyWrapper.roboRallyGame;
roboRallyWrapper.roboRallyGame = debugGame;
this.debugGame = temp;
return true;

View File

@@ -45,19 +45,13 @@ public class LoadingScreen extends AbstractScreen {
roboRallyWrapper.batch.end();
long time = System.currentTimeMillis();
//TODO: Allow to set any condition and next screen
if (roboRallyWrapper.roboRallyGame != null && roboRallyWrapper.roboRallyGame.getGameState() != initialGameState ) {
if (roboRallyWrapper.roboRallyGame != null && roboRallyWrapper.roboRallyGame.getGameState() != initialGameState) {
handleScreenChange();
}
}
private void handleScreenChange() {
switch (initialGameState) {
case BEGINNING_OF_GAME:
if(roboRallyWrapper.roboRallyGame.getClient()==null){
roboRallyWrapper.roboRallyGame.setClient(roboRallyWrapper.client);
roboRallyWrapper.roboRallyGame.setServer(roboRallyWrapper.server);
}
case SENDING_CARDS:
roboRallyWrapper.setScreen(roboRallyWrapper.screenManager.getBoardActiveScreen(this.roboRallyWrapper));
break;