Skip to content

Commit

Permalink
Rename the options fields to make their purpose more clear
Browse files Browse the repository at this point in the history
  • Loading branch information
Garanas committed May 22, 2024
1 parent cc7c808 commit b222645
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,6 @@

public record GameScenario(String mapPath, Integer mapVersion, String mapDescription, String mapScript, String mapSave,
String mapName, Integer mapSizeX, Integer mapSizeZ, Integer reclaimMassValue,
Integer reclaimEnergyValue, GameOptions primaryGameOptions,
Map<String, String> secondaryGameOptions) {
Integer reclaimEnergyValue, GameOptions gameOptions,
Map<String, String> modOptions) {
}
Original file line number Diff line number Diff line change
Expand Up @@ -103,11 +103,11 @@ public static ReplayHeader parse(LittleEndianDataInputStream dataStream) throws
if (gameScenario instanceof LuaData.Table table) {

// retrieve and manage the game options
GameOptions primaryOptions = null;
Map<String, String> secondaryOptions = null;
GameOptions gameOptions = null;
Map<String, String> modOptions = null;
if (table.value().get("Options") instanceof LuaData.Table optionsTable) {

primaryOptions = new GameOptions(
gameOptions = new GameOptions(
GameOptions.AutoTeams.findByKey(optionsTable.getString("AutoTeams")),
GameOptions.TeamLock.findByKey(optionsTable.getString("TeamLock")),
GameOptions.TeamSpawn.findByKey(optionsTable.getString("TeamSpawn")),
Expand All @@ -133,7 +133,7 @@ public static ReplayHeader parse(LittleEndianDataInputStream dataStream) throws
optionsTable.removeKey("Unranked");
optionsTable.removeKey("Victory");

secondaryOptions = optionsTable.toMap();
modOptions = optionsTable.toMap();
}

Integer sizeX = null;
Expand All @@ -159,7 +159,7 @@ public static ReplayHeader parse(LittleEndianDataInputStream dataStream) throws
table.getString("name"),
sizeX, sizeZ,
massReclaimValue, energyReclaimValue,
primaryOptions, secondaryOptions
gameOptions, modOptions
);

}
Expand Down

0 comments on commit b222645

Please sign in to comment.