mirror of
https://github.com/inf112-v20/Fiasko.git
synced 2025-01-31 23:29:36 +01:00
Legger til manglende mellomrom for bedre kodestil
This commit is contained in:
parent
b5eae63892
commit
a2dc09f48c
@ -206,17 +206,17 @@ public class BoardActiveScreen extends AbstractScreen implements InputProcessor
|
|||||||
int cameraUpX = Math.round(camera.up.x);
|
int cameraUpX = Math.round(camera.up.x);
|
||||||
int cameraUpY = Math.round(camera.up.y);
|
int cameraUpY = Math.round(camera.up.y);
|
||||||
if (cameraUpX == 0 && Math.round(camera.up.y) == 1) {
|
if (cameraUpX == 0 && Math.round(camera.up.y) == 1) {
|
||||||
outX = (int)-x;
|
outX = (int) -x;
|
||||||
outY = (int)y;
|
outY = (int) y;
|
||||||
} else if (cameraUpX == 0 && cameraUpY == -1) {
|
} else if (cameraUpX == 0 && cameraUpY == -1) {
|
||||||
outX = (int)x;
|
outX = (int) x;
|
||||||
outY = (int)-y;
|
outY = (int) -y;
|
||||||
} else if (cameraUpX == -1 && cameraUpY == 0) {
|
} else if (cameraUpX == -1 && cameraUpY == 0) {
|
||||||
outX = (int)-y;
|
outX = (int) -y;
|
||||||
outY = (int)-x;
|
outY = (int) -x;
|
||||||
} else if (cameraUpX == 1 && cameraUpY == 0) {
|
} else if (cameraUpX == 1 && cameraUpY == 0) {
|
||||||
outX = (int)y;
|
outX = (int) y;
|
||||||
outY = (int)x;
|
outY = (int) x;
|
||||||
}
|
}
|
||||||
return new int[]{outX, outY};
|
return new int[]{outX, outY};
|
||||||
}
|
}
|
||||||
|
@ -174,7 +174,7 @@ public class Board {
|
|||||||
* sets the damage taken of robots in powerdown to 0
|
* sets the damage taken of robots in powerdown to 0
|
||||||
*/
|
*/
|
||||||
public void executePowerdown() {
|
public void executePowerdown() {
|
||||||
for (Robot robot:robots.values()) {
|
for (Robot robot : robots.values()) {
|
||||||
if (robot.isInPowerDown()) {
|
if (robot.isInPowerDown()) {
|
||||||
robot.setDamageTaken(0);
|
robot.setDamageTaken(0);
|
||||||
}
|
}
|
||||||
@ -655,7 +655,7 @@ public class Board {
|
|||||||
Direction laserDirection = Direction.getReverseDirection(wallLaser.getElement().getDirection());
|
Direction laserDirection = Direction.getReverseDirection(wallLaser.getElement().getDirection());
|
||||||
List<Position> laserTargets = new ArrayList<>();
|
List<Position> laserTargets = new ArrayList<>();
|
||||||
getLaserTarget(laserDirection, wallLaser.getPosition(), laserTargets);
|
getLaserTarget(laserDirection, wallLaser.getPosition(), laserTargets);
|
||||||
Position hitPosition = laserTargets.get(laserTargets.size()-1);
|
Position hitPosition = laserTargets.get(laserTargets.size() - 1);
|
||||||
WallType laserType = wallLaser.getElement().getWallType();
|
WallType laserType = wallLaser.getElement().getWallType();
|
||||||
updateLaserDisplay(laserTargets, laserDirection, laserType);
|
updateLaserDisplay(laserTargets, laserDirection, laserType);
|
||||||
if (getRobotOnPosition(hitPosition) != null) {
|
if (getRobotOnPosition(hitPosition) != null) {
|
||||||
@ -675,7 +675,7 @@ public class Board {
|
|||||||
}
|
}
|
||||||
List<Position> laserTargets = new ArrayList<>();
|
List<Position> laserTargets = new ArrayList<>();
|
||||||
getLaserTarget(robotDirection, positionInFront, laserTargets);
|
getLaserTarget(robotDirection, positionInFront, laserTargets);
|
||||||
Position hitPosition = laserTargets.get(laserTargets.size()-1);
|
Position hitPosition = laserTargets.get(laserTargets.size() - 1);
|
||||||
WallType laserType = WallType.WALL_LASER_SINGLE;
|
WallType laserType = WallType.WALL_LASER_SINGLE;
|
||||||
updateLaserDisplay(laserTargets, robotDirection, laserType);
|
updateLaserDisplay(laserTargets, robotDirection, laserType);
|
||||||
if (getRobotOnPosition(hitPosition) != null) {
|
if (getRobotOnPosition(hitPosition) != null) {
|
||||||
|
@ -580,7 +580,7 @@ public class RoboRallyGame implements IRoboRallyGame {
|
|||||||
* Checks all flags for robots. Tries to update the flag of the robot.
|
* Checks all flags for robots. Tries to update the flag of the robot.
|
||||||
*/
|
*/
|
||||||
private void checkAllFlags() {
|
private void checkAllFlags() {
|
||||||
for (BoardElementContainer<Tile> flag:flags) {
|
for (BoardElementContainer<Tile> flag : flags) {
|
||||||
Position flagPosition = flag.getPosition();
|
Position flagPosition = flag.getPosition();
|
||||||
if (gameBoard.hasRobotOnPosition(flagPosition)) {
|
if (gameBoard.hasRobotOnPosition(flagPosition)) {
|
||||||
RobotID robotID = gameBoard.getRobotOnPosition(flagPosition);
|
RobotID robotID = gameBoard.getRobotOnPosition(flagPosition);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user