Skip to content

Commit 9dca531

Browse files
author
Jarand
authored
Merge pull request #10 from Jarand95/master
Last PR for now.
2 parents 0d5e6c6 + df05975 commit 9dca531

25 files changed

+562
-539
lines changed

src/main/java/no/hvl/dowhile/core/Config.java

+42
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,17 @@
1616
public class Config {
1717
private String filename;
1818
private List<TeamType> teamTypes;
19+
private String redLabel;
20+
private String greenLabel;
1921

2022
/**
2123
* Constructor setting a default filename.
2224
*/
2325
public Config() {
2426
this.filename = "%LAGTYPE%%LAGNUMMER%_TEIG%TEIGNUMMER%_SPOR%SPORNUMMER%_%DATO%.gpx";
2527
this.teamTypes = new ArrayList<>();
28+
this.redLabel = "Etterretning";
29+
this.greenLabel = "Info";
2630
}
2731

2832
/**
@@ -53,6 +57,10 @@ public String[] getConfigTemplate() {
5357
"team=Mannskap,color=Green",
5458
"team=Hund,color=Magenta",
5559
"team=Helikopter,color=DarkRed",
60+
"#",
61+
"# Velg beskrivelse av flaggfarge på veipunkt:",
62+
"red-label=Etterretning",
63+
"green-label=Info"
5664
};
5765
}
5866

@@ -111,6 +119,24 @@ public List<String> getTeamNames() {
111119
return teamNames;
112120
}
113121

122+
/**
123+
* Get the label for the red color on waypoint flag color selector.
124+
*
125+
* @return the label for the red color.
126+
*/
127+
public String getRedLabel() {
128+
return redLabel;
129+
}
130+
131+
/**
132+
* Gets the label for the green color on waypoint flag color selector.
133+
*
134+
* @return the label for the green color.
135+
*/
136+
public String getGreenLabel() {
137+
return greenLabel;
138+
}
139+
114140
/**
115141
* Parses the config file and extracts the needed information.
116142
*
@@ -144,6 +170,22 @@ public void parseConfigFile(File file) {
144170
System.err.println("[Config] Parsed team type " + teamType + " with color " + teamColor);
145171
}
146172
}
173+
} else if (line.startsWith("red-label")) {
174+
if (line.contains("=")) {
175+
String[] parts = line.split("=");
176+
if (parts.length == 2) {
177+
redLabel = parts[1];
178+
System.err.println("[Config] Parsed label for red waypoint flag color " + redLabel);
179+
}
180+
}
181+
} else if (line.startsWith("green-label")) {
182+
if (line.contains("=")) {
183+
String[] parts = line.split("=");
184+
if (parts.length == 2) {
185+
greenLabel = parts[1];
186+
System.err.println("[Config] Parsed label for green waypoint flag color " + greenLabel);
187+
}
188+
}
147189
}
148190
}
149191
line = reader.readLine();

0 commit comments

Comments
 (0)