-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGameplayChange.java
More file actions
35 lines (29 loc) · 862 Bytes
/
Copy pathGameplayChange.java
File metadata and controls
35 lines (29 loc) · 862 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package com.dd;
import com.dd.darkest.DarkestFile;
import java.io.File;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
public abstract class GameplayChange {
public abstract void makeGameplayChanges(Map<File, DarkestFile> darkestFiles);
protected String integerListToDarkestPropertyValue(List<Integer> ints) {
List<String> toStrs = new ArrayList<String>();
for (Integer i : ints) {
toStrs.add(i.toString());
}
return String.join(" ", toStrs);
}
protected List<Integer> parsePropertyIntegerList(String propertyValue) {
List<Integer> integerValues = new ArrayList<Integer>();
String[] values = propertyValue.split("\\s");
for (String value : values) {
try {
integerValues.add(Integer.parseInt(value));
} catch (Exception e) {
integerValues = null;
break;
}
}
return integerValues;
}
}