Legger til en test server i RoboRallyWrapper

This commit is contained in:
Kristian Knarvik 2020-03-12 11:20:37 +01:00
parent b0ebb2db3e
commit 08e2a61457

View File

@ -3,8 +3,13 @@ package inf112.fiasko.roborally.game_wrapper;
import com.badlogic.gdx.Game; import com.badlogic.gdx.Game;
import com.badlogic.gdx.graphics.g2d.BitmapFont; import com.badlogic.gdx.graphics.g2d.BitmapFont;
import com.badlogic.gdx.graphics.g2d.SpriteBatch; import com.badlogic.gdx.graphics.g2d.SpriteBatch;
import inf112.fiasko.roborally.networking.RoboRallyClient;
import inf112.fiasko.roborally.networking.RoboRallyServer;
import inf112.fiasko.roborally.networking.SomeResponse;
import inf112.fiasko.roborally.objects.IDrawableGame; import inf112.fiasko.roborally.objects.IDrawableGame;
import java.io.IOException;
public class RoboRallyWrapper extends Game { public class RoboRallyWrapper extends Game {
public SpriteBatch batch; public SpriteBatch batch;
public BitmapFont font; public BitmapFont font;
@ -17,6 +22,15 @@ public class RoboRallyWrapper extends Game {
font = new BitmapFont(); font = new BitmapFont();
this.screenManager = new ScreenManager(); this.screenManager = new ScreenManager();
this.setScreen(screenManager.getMainMenuScreen(this)); this.setScreen(screenManager.getMainMenuScreen(this));
try {
RoboRallyServer server = new RoboRallyServer();
RoboRallyClient client = new RoboRallyClient();
SomeResponse response = new SomeResponse();
response.text = "ÆÆÆÆÆÆÆÆÆ";
server.sendToAllClients(response);
} catch (IOException e) {
e.printStackTrace();
}
} }
public void dispose() { public void dispose() {