reformatted code
This commit is contained in:
parent
d0d656452c
commit
1ab13398bb
@ -1,7 +1,6 @@
|
||||
package cicaprojekt;
|
||||
|
||||
public class Box implements Pickable, Destroyable
|
||||
{
|
||||
public class Box implements Pickable, Destroyable {
|
||||
private int weight = 5;
|
||||
|
||||
|
||||
|
@ -3,12 +3,10 @@ package cicaprojekt;
|
||||
import java.io.*;
|
||||
|
||||
public class Dungeon {
|
||||
cicaprojekt.Tile buildDungeon(File input) throws IOException
|
||||
{
|
||||
cicaprojekt.Tile buildDungeon(File input) throws IOException {
|
||||
Tile oneilllocation = null;
|
||||
Tile jaffalocation = null;
|
||||
try(BufferedReader reader = new BufferedReader(new FileReader(input)))
|
||||
{
|
||||
try (BufferedReader reader = new BufferedReader(new FileReader(input))) {
|
||||
String[] sizedata = reader.readLine().split("x"); // read size data at beginning of file
|
||||
reader.readLine(); // throw empty line away
|
||||
int width = Integer.parseInt(sizedata[0]);
|
||||
@ -19,11 +17,9 @@ public class Dungeon {
|
||||
String line = null;
|
||||
Gate gate = new Gate();
|
||||
Gate lastgate = gate;
|
||||
for (int y = 0; y < height; ++y)
|
||||
{
|
||||
for (int y = 0; y < height; ++y) {
|
||||
line = reader.readLine().replaceAll("\\s", ""); // read line and remove whitespaces
|
||||
for (int x = 0; x < width; ++x)
|
||||
{
|
||||
for (int x = 0; x < width; ++x) {
|
||||
switch (line.charAt(x)) // set the dungeon up
|
||||
{
|
||||
case 'W':
|
||||
@ -74,10 +70,8 @@ public class Dungeon {
|
||||
// NOTE: code seems to be correct till this point based on a debugger run-through
|
||||
|
||||
/* setting up Tile cross references */
|
||||
for (int y = 0; y < height; ++y)
|
||||
{
|
||||
for (int x = 0; x < width; ++x)
|
||||
{
|
||||
for (int y = 0; y < height; ++y) {
|
||||
for (int x = 0; x < width; ++x) {
|
||||
if (x - 1 >= 0) // leftwards Tile reference
|
||||
dungeon[y][x].setAdajacentTile(dungeon[y][x - 1], Direction.WEST);
|
||||
else
|
||||
|
@ -3,8 +3,7 @@ package cicaprojekt;
|
||||
import java.util.HashMap;
|
||||
import java.util.Map;
|
||||
|
||||
public class Field extends cicaprojekt.Tile
|
||||
{
|
||||
public class Field extends cicaprojekt.Tile {
|
||||
private static int recursionLimit = 0;
|
||||
|
||||
|
||||
|
@ -8,7 +8,6 @@ public class FlowOfTime extends Timer{
|
||||
private long gametime;
|
||||
|
||||
|
||||
public void start()
|
||||
{
|
||||
public void start() {
|
||||
}
|
||||
}
|
||||
|
@ -2,9 +2,12 @@ package cicaprojekt;
|
||||
|
||||
public class Game {
|
||||
private Player oneill;
|
||||
|
||||
private Dungeon dungeon;
|
||||
private FlowOfTime flowoftime;
|
||||
|
||||
public static void main(String[] args) {
|
||||
}
|
||||
|
||||
public void allZPMsCollected() {
|
||||
this.stopGame();
|
||||
@ -15,6 +18,4 @@ public class Game {
|
||||
|
||||
public void stopGame() {
|
||||
}
|
||||
|
||||
public static void main(String[] args) {}
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
package cicaprojekt;
|
||||
|
||||
public class Gap extends cicaprojekt.Tile
|
||||
{
|
||||
public class Gap extends cicaprojekt.Tile {
|
||||
public Gap() {
|
||||
super();
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
package cicaprojekt;
|
||||
|
||||
public class Gate extends Tile
|
||||
{
|
||||
public class Gate extends Tile {
|
||||
private boolean open = false;
|
||||
|
||||
public Gate() {
|
||||
@ -15,8 +14,7 @@ public class Gate extends Tile
|
||||
public void onEntry(PlayerBase playerBase) {
|
||||
if (open) {
|
||||
playerBase.setCurrentTile(this);
|
||||
}
|
||||
else
|
||||
} else
|
||||
return;
|
||||
}
|
||||
|
||||
|
@ -7,13 +7,11 @@ public class Menu {
|
||||
public static String tabulator = "\t";
|
||||
|
||||
|
||||
public static void addTab()
|
||||
{
|
||||
public static void addTab() {
|
||||
tabulator += '\t';
|
||||
}
|
||||
|
||||
public static void removeTab()
|
||||
{
|
||||
public static void removeTab() {
|
||||
tabulator = tabulator.substring(0, tabulator.length() - 1);
|
||||
}
|
||||
|
||||
|
@ -24,8 +24,7 @@ public class Player extends PlayerBase{
|
||||
}
|
||||
|
||||
@Override
|
||||
public void pickZPM(Tile tile)
|
||||
{
|
||||
public void pickZPM(Tile tile) {
|
||||
zpmContainer.add(tile.getZPMFromTile());
|
||||
}
|
||||
|
||||
|
@ -6,7 +6,8 @@ public class PlayerBase implements Destroyable{
|
||||
protected Direction facingDirection;
|
||||
|
||||
|
||||
public void destroy() {}
|
||||
public void destroy() {
|
||||
}
|
||||
|
||||
public Tile getCurrentTile() {
|
||||
return currentTile;
|
||||
|
@ -1,14 +1,12 @@
|
||||
package cicaprojekt;
|
||||
|
||||
public class Stargate {
|
||||
private boolean isSpawned;
|
||||
|
||||
public static final Stargate yellowStargate = new Stargate();
|
||||
public static final Stargate blueStargate = new Stargate();
|
||||
public static final Stargate redStargate = new Stargate();
|
||||
public static final Stargate greenStargate = new Stargate();
|
||||
public /*final*/ Stargate other; //TODO find better ways to do this
|
||||
|
||||
private boolean isSpawned;
|
||||
private Wall currentWall;
|
||||
|
||||
|
||||
|
@ -21,8 +21,7 @@ public class Wall extends Tile {
|
||||
public void onEntry(PlayerBase playerBase) {
|
||||
if (sg == null) {
|
||||
return;
|
||||
}
|
||||
else {
|
||||
} else {
|
||||
sg.teleport(playerBase.facingDirection);
|
||||
}
|
||||
}
|
||||
|
@ -1,7 +1,6 @@
|
||||
package cicaprojekt;
|
||||
|
||||
public class ZPM implements Pickable
|
||||
{
|
||||
public class ZPM implements Pickable {
|
||||
public void pick() {
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user