mirror of
https://github.com/inf112-v20/Fiasko.git
synced 2025-01-31 23:29:36 +01:00
Gjør slik at et IDrawableGame returnerer en liste med partikler
This commit is contained in:
parent
1a17473d89
commit
29a65e51ac
@ -39,6 +39,16 @@ public interface IDrawableGame {
|
|||||||
*/
|
*/
|
||||||
List<Wall> getWallsToDraw();
|
List<Wall> getWallsToDraw();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Gets a list of all the particles to be drawn
|
||||||
|
*
|
||||||
|
* Should return a list readable from top-left to top-right and so on. In other words, the first getWidth()
|
||||||
|
* particles should be drawn on the top row from left to right.
|
||||||
|
*
|
||||||
|
* @return A list of particles
|
||||||
|
*/
|
||||||
|
List<Particle> getParticlesToDraw();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Gets a list of all robots to draw
|
* Gets a list of all robots to draw
|
||||||
* @return A list of all robots to draw
|
* @return A list of all robots to draw
|
||||||
|
@ -50,6 +50,11 @@ public class RoboRallyGame implements IDrawableGame {
|
|||||||
return gameBoard.getWalls();
|
return gameBoard.getWalls();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public List<Particle> getParticlesToDraw() {
|
||||||
|
return gameBoard.getParticles();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public List<Robot> getRobotsToDraw() {
|
public List<Robot> getRobotsToDraw() {
|
||||||
return gameBoard.getAliveRobots();
|
return gameBoard.getAliveRobots();
|
||||||
@ -97,7 +102,7 @@ public class RoboRallyGame implements IDrawableGame {
|
|||||||
robots.add(new Robot(RobotID.ROBOT_6, new Position(7, 7)));
|
robots.add(new Robot(RobotID.ROBOT_6, new Position(7, 7)));
|
||||||
robots.add(new Robot(RobotID.ROBOT_7, new Position(6, 7)));
|
robots.add(new Robot(RobotID.ROBOT_7, new Position(6, 7)));
|
||||||
robots.add(new Robot(RobotID.ROBOT_8, new Position(6, 8)));
|
robots.add(new Robot(RobotID.ROBOT_8, new Position(6, 8)));
|
||||||
gameBoard = BoardLoaderUtil.loadBoard("boards/Checkmate.txt", robots);
|
gameBoard = BoardLoaderUtil.loadBoard("boards/Dizzy_Dash.txt", robots);
|
||||||
cogwheels = gameBoard.getPositionsOfTileOnBoard(TileType.COGWHEEL_RIGHT,
|
cogwheels = gameBoard.getPositionsOfTileOnBoard(TileType.COGWHEEL_RIGHT,
|
||||||
TileType.COGWHEEL_LEFT);
|
TileType.COGWHEEL_LEFT);
|
||||||
fastConveyorBelts = gameBoard.getPositionsOfTileOnBoard(TileType.CONVEYOR_BELT_FAST,
|
fastConveyorBelts = gameBoard.getPositionsOfTileOnBoard(TileType.CONVEYOR_BELT_FAST,
|
||||||
@ -133,6 +138,7 @@ public class RoboRallyGame implements IDrawableGame {
|
|||||||
TimeUnit.SECONDS.sleep(3);
|
TimeUnit.SECONDS.sleep(3);
|
||||||
makeMove(RobotID.ROBOT_1, Action.MOVE_1);
|
makeMove(RobotID.ROBOT_1, Action.MOVE_1);
|
||||||
makeMove(RobotID.ROBOT_1, Action.MOVE_2);
|
makeMove(RobotID.ROBOT_1, Action.MOVE_2);
|
||||||
|
fireAllLasers();
|
||||||
makeMove(RobotID.ROBOT_1, Action.BACK_UP);
|
makeMove(RobotID.ROBOT_1, Action.BACK_UP);
|
||||||
makeMove(RobotID.ROBOT_1, Action.BACK_UP);
|
makeMove(RobotID.ROBOT_1, Action.BACK_UP);
|
||||||
makeMove(RobotID.ROBOT_1, Action.MOVE_3);
|
makeMove(RobotID.ROBOT_1, Action.MOVE_3);
|
||||||
@ -157,7 +163,6 @@ public class RoboRallyGame implements IDrawableGame {
|
|||||||
checkAllFlags();
|
checkAllFlags();
|
||||||
rotateCogwheels();
|
rotateCogwheels();
|
||||||
makeMove(RobotID.ROBOT_7, Action.MOVE_1);
|
makeMove(RobotID.ROBOT_7, Action.MOVE_1);
|
||||||
fireAllLasers();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -365,6 +370,9 @@ public class RoboRallyGame implements IDrawableGame {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fires all lasers on the game board
|
||||||
|
*/
|
||||||
private void fireAllLasers() {
|
private void fireAllLasers() {
|
||||||
gameBoard.fireAllLasers();
|
gameBoard.fireAllLasers();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user