|
|
@@ -1,8 +1,5 @@
|
|
|
package puzzeltocht.domain;
|
|
|
|
|
|
-import java.util.ArrayList;
|
|
|
-import java.util.Collections;
|
|
|
-import java.util.List;
|
|
|
import java.util.UUID;
|
|
|
|
|
|
public class Team {
|
|
|
@@ -10,7 +7,7 @@ public class Team {
|
|
|
private final String name;
|
|
|
private Mission currentMission;
|
|
|
private Location currentLocation;
|
|
|
- private final List<Location> locationHistory = new ArrayList<>();
|
|
|
+// private final List<Location> locationHistory = new ArrayList<>();
|
|
|
|
|
|
public Team(String name) {
|
|
|
this.id = UUID.randomUUID();
|
|
|
@@ -42,22 +39,22 @@ public class Team {
|
|
|
return;
|
|
|
}
|
|
|
this.currentLocation = l;
|
|
|
- updateHistory(l);
|
|
|
- }
|
|
|
-
|
|
|
- public List<Location> getLocationHistory() {
|
|
|
- return Collections.unmodifiableList(locationHistory);
|
|
|
- }
|
|
|
-
|
|
|
- private void updateHistory(Location l) {
|
|
|
- // Voor de start en na de finish geen history bijhouden
|
|
|
- if (currentMission.getType() == MissionType.START || currentMission.getType() == MissionType.FINISH) {
|
|
|
- return;
|
|
|
- }
|
|
|
- // Geschiedenis alleen bijwerken als het de eerste locatie is of de voldende minimaal 10m verder is.
|
|
|
- if (locationHistory.isEmpty() || locationHistory.get(locationHistory.size() - 1).distanceTo(l) >= 10) {
|
|
|
- locationHistory.add(l);
|
|
|
- }
|
|
|
- }
|
|
|
+// updateHistory(l);
|
|
|
+ }
|
|
|
+
|
|
|
+// public List<Location> getLocationHistory() {
|
|
|
+// return Collections.unmodifiableList(locationHistory);
|
|
|
+// }
|
|
|
+//
|
|
|
+// private void updateHistory(Location l) {
|
|
|
+// // Voor de start en na de finish geen history bijhouden
|
|
|
+// if (currentMission.getType() == MissionType.START || currentMission.getType() == MissionType.FINISH) {
|
|
|
+// return;
|
|
|
+// }
|
|
|
+// // Geschiedenis alleen bijwerken als het de eerste locatie is of de voldende minimaal 10m verder is.
|
|
|
+// if (locationHistory.isEmpty() || locationHistory.get(locationHistory.size() - 1).distanceTo(l) >= 10) {
|
|
|
+// locationHistory.add(l);
|
|
|
+// }
|
|
|
+// }
|
|
|
|
|
|
}
|