forked from SteamWar/SteamWar
Fix Flag.Value to have enum methods for save/load
This commit is contained in:
+5
@@ -74,4 +74,9 @@ public class FixedFlagStorage implements FlagStorage {
|
||||
public void clear() {
|
||||
flagMap.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Flag<?>, Flag.Value<?>> getBackedMap() {
|
||||
return flagMap;
|
||||
}
|
||||
}
|
||||
|
||||
+5
@@ -78,4 +78,9 @@ public class FixedGlobalFlagStorage implements FlagStorage {
|
||||
public void clear() {
|
||||
flagMap.clear();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<Flag<?>, Flag.Value<?>> getBackedMap() {
|
||||
return flagMap;
|
||||
}
|
||||
}
|
||||
|
||||
+6
-2
@@ -28,9 +28,13 @@ import java.util.UUID;
|
||||
public class FixedRegion implements Region {
|
||||
|
||||
private UUID uuid;
|
||||
private FixedFlagStorage flagStorage;
|
||||
private Prototype prototype;
|
||||
|
||||
public FixedRegion(String name) {
|
||||
public FixedRegion(String name, FixedFlagStorage flagStorage, Prototype prototype) {
|
||||
uuid = UUID.nameUUIDFromBytes(name.getBytes(StandardCharsets.UTF_8));
|
||||
this.flagStorage = flagStorage;
|
||||
this.prototype = prototype;
|
||||
}
|
||||
|
||||
@Override
|
||||
@@ -45,7 +49,7 @@ public class FixedRegion implements Region {
|
||||
|
||||
@Override
|
||||
public @NonNull FlagStorage getFlags() {
|
||||
return null;
|
||||
return flagStorage;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
Reference in New Issue
Block a user