Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions src/main/java/org/example/Journey.java
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,4 @@ public int getRemainingDistance() {
return remainingDistance;
}

public int getTurnNumber() {
return turnNumber;
}

}
4 changes: 0 additions & 4 deletions src/main/java/org/example/Location.java
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ public void setName(String name) {
this.name = name;
}

public void setType(LocationType type) {
this.type = type;
}

public int getX() {
return x;
}
Expand Down
9 changes: 0 additions & 9 deletions src/main/java/org/example/LocationLink.java
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,6 @@ public class LocationLink {
@OneToMany(mappedBy = "locationLink")
private Set<TransportLink> transportLinks = new HashSet<>();


public LocationLink() {}

public LocationLink(Location fromLocation, Location toLocation, int distance) {
this.fromLocation = fromLocation;
this.toLocation = toLocation;
this.distance = distance;
}

public Long getId() {
return id;
}
Expand Down
20 changes: 0 additions & 20 deletions src/main/java/org/example/Transport.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,25 +25,6 @@ public class Transport {

public Transport(){}

public Transport(TransportType type, String costPerMove) {
this.type = type;
this.costPerMove = new BigDecimal(costPerMove);
switch (type){
case BUSS -> {
this.diceCount = 1;
this.diceSides = 6;
}
case TRAIN -> {
this.diceCount = 2;
this.diceSides = 6;
}
case AIRPLANE -> {
this.diceCount = 3;
this.diceSides = 6;
}
}
}

public int rollDistance() {
Random r = new Random();
int total = 0;
Expand All @@ -65,5 +46,4 @@ public String getType() {
return type.toString();
}


}
4 changes: 0 additions & 4 deletions src/main/java/org/example/TransportLink.java
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ public Long getId() {
return id;
}

public LocationLink getLocationLink() {
return locationLink;
}

public Transport getTransport() {
return transport;
}
Expand Down
1 change: 0 additions & 1 deletion src/main/java/org/example/TravelGame.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ public void start(Stage stage) throws Exception {
dialog.setContentText("Ange ditt spelarnamn:");
dialog.setGraphic(null);

DialogPane dialogPane = dialog.getDialogPane(); // ok att ha kvar eller ta bort
Optional<String> result = dialog.showAndWait();

if (result.isPresent() && !result.get().trim().isEmpty()) {
Expand Down
8 changes: 8 additions & 0 deletions src/main/java/org/example/Traveler.java
Original file line number Diff line number Diff line change
Expand Up @@ -206,4 +206,12 @@ public void deductMoney(BigDecimal amount) {
this.money = next.signum() < 0 ? BigDecimal.ZERO : next;
}

public void cancelJourney() {
this.targetLocation = null;
this.remainingDistance = 0;
// destinationPos kan du låta vara, eller synca till current:
// setDestinationPos(currentLocation.getX(), currentLocation.getY());
}


}
21 changes: 0 additions & 21 deletions src/main/java/org/example/service/EventResult.java

This file was deleted.