|
|
@@ -1,16 +1,23 @@
|
|
|
package puzzeltocht.controller.dto;
|
|
|
|
|
|
+import puzzeltocht.domain.Mission;
|
|
|
+import puzzeltocht.domain.MissionType;
|
|
|
import puzzeltocht.domain.Team;
|
|
|
|
|
|
public class TeamDto {
|
|
|
private final String name;
|
|
|
private final String mission;
|
|
|
+ private final boolean started;
|
|
|
+ private final boolean finished;
|
|
|
private final LocationDto location;
|
|
|
|
|
|
public TeamDto(Team t) {
|
|
|
this.name = t.getName();
|
|
|
this.location = t.getCurrentLocation() == null ? null : new LocationDto(t.getCurrentLocation());
|
|
|
- this.mission = t.getCurrentMission() == null ? null : t.getCurrentMission().getTitle();
|
|
|
+ Mission m = t.getCurrentMission();
|
|
|
+ this.mission = m == null ? null : m.getTitle();
|
|
|
+ this.started = m != null && m.getType() != MissionType.START;
|
|
|
+ this.finished = m != null && m.getType() == MissionType.FINISH;
|
|
|
}
|
|
|
|
|
|
public String getName() {
|
|
|
@@ -21,6 +28,14 @@ public class TeamDto {
|
|
|
return mission;
|
|
|
}
|
|
|
|
|
|
+ public boolean isStarted() {
|
|
|
+ return started;
|
|
|
+ }
|
|
|
+
|
|
|
+ public boolean isFinished() {
|
|
|
+ return finished;
|
|
|
+ }
|
|
|
+
|
|
|
public LocationDto getLocation() {
|
|
|
return location;
|
|
|
}
|