Flytter noen klasser og tar ibruk RoboRallyLauncher. Closes #20

Flytter IDrawableGame og RoboRallyGame (tidligere Game) til Objects
Korrigerer navn i RoboRallyGameTest (tidligere GameTest)
Korrigerer pakkeendringer i IOUtil
This commit is contained in:
Kristian Knarvik 2020-03-02 18:46:45 +01:00
parent 6f26ec6307
commit c53a4cb8d6
5 changed files with 14 additions and 18 deletions

View File

@ -2,6 +2,7 @@ package inf112.fiasko.roborally;
import com.badlogic.gdx.backends.lwjgl.LwjglApplication; import com.badlogic.gdx.backends.lwjgl.LwjglApplication;
import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration; import com.badlogic.gdx.backends.lwjgl.LwjglApplicationConfiguration;
import inf112.fiasko.roborally.game_wrapper.RoboRallyLauncher;
public class Main { public class Main {
@ -12,6 +13,6 @@ public class Main {
cfg.height = 900; cfg.height = 900;
cfg.samples = 3; cfg.samples = 3;
new LwjglApplication(new GameLauncher(), cfg); new LwjglApplication(new RoboRallyLauncher(), cfg);
} }
} }

View File

@ -1,8 +1,4 @@
package inf112.fiasko.roborally.game; package inf112.fiasko.roborally.objects;
import inf112.fiasko.roborally.objects.Robot;
import inf112.fiasko.roborally.objects.Tile;
import inf112.fiasko.roborally.objects.Wall;
import java.util.List; import java.util.List;

View File

@ -1,11 +1,7 @@
package inf112.fiasko.roborally.game; package inf112.fiasko.roborally.objects;
import inf112.fiasko.roborally.element_properties.Position; import inf112.fiasko.roborally.element_properties.Position;
import inf112.fiasko.roborally.element_properties.RobotID; import inf112.fiasko.roborally.element_properties.RobotID;
import inf112.fiasko.roborally.objects.Board;
import inf112.fiasko.roborally.objects.Robot;
import inf112.fiasko.roborally.objects.Tile;
import inf112.fiasko.roborally.objects.Wall;
import inf112.fiasko.roborally.utility.BoardLoaderUtil; import inf112.fiasko.roborally.utility.BoardLoaderUtil;
import java.io.IOException; import java.io.IOException;
@ -16,10 +12,10 @@ import java.util.concurrent.TimeUnit;
/** /**
* This class represent a game which is drawable using libgdx * This class represent a game which is drawable using libgdx
*/ */
public class Game implements IDrawableGame { public class RoboRallyGame implements IDrawableGame {
private Board gameBoard; private Board gameBoard;
public Game(boolean debug) { public RoboRallyGame(boolean debug) {
if (debug) { if (debug) {
initializeDebugMode(); initializeDebugMode();
} else { } else {
@ -27,7 +23,7 @@ public class Game implements IDrawableGame {
} }
} }
public Game() { public RoboRallyGame() {
initializeGame(); initializeGame();
} }

View File

@ -3,7 +3,7 @@ package inf112.fiasko.roborally.utility;
import com.badlogic.gdx.graphics.g2d.TextureRegion; import com.badlogic.gdx.graphics.g2d.TextureRegion;
import inf112.fiasko.roborally.element_properties.Direction; import inf112.fiasko.roborally.element_properties.Direction;
import inf112.fiasko.roborally.element_properties.Position; import inf112.fiasko.roborally.element_properties.Position;
import inf112.fiasko.roborally.game.IDrawableGame; import inf112.fiasko.roborally.objects.IDrawableGame;
import inf112.fiasko.roborally.objects.DrawableObject; import inf112.fiasko.roborally.objects.DrawableObject;
import inf112.fiasko.roborally.objects.IDrawableObject; import inf112.fiasko.roborally.objects.IDrawableObject;
import inf112.fiasko.roborally.objects.Robot; import inf112.fiasko.roborally.objects.Robot;

View File

@ -1,15 +1,18 @@
package inf112.fiasko.roborally.game; package inf112.fiasko.roborally.game_wrapper;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
import inf112.fiasko.roborally.objects.IDrawableGame;
import inf112.fiasko.roborally.objects.RoboRallyGame;
import org.junit.Before; import org.junit.Before;
import org.junit.Test; import org.junit.Test;
public class GameTest { public class RoboRallyGameTest {
private IDrawableGame game; private IDrawableGame game;
@Before @Before
public void setUp() { public void setUp() {
game = new Game(); game = new RoboRallyGame();
} }
@Test @Test