Change to adapt to AcediaCore's changes
This commit is contained in:
parent
1e9e146a9f
commit
a026b731ee
@ -54,80 +54,82 @@ var protected config array<FeatureConfigPair> includeFeatureAs;
|
||||
|
||||
var private LoggerAPI.Definition warnBadMutatorName, warnBadFeatureName;
|
||||
|
||||
protected function AssociativeArray ToData()
|
||||
protected function HashTable ToData()
|
||||
{
|
||||
local int i;
|
||||
local AssociativeArray result;
|
||||
local AssociativeArray nextPair;
|
||||
local DynamicArray nextArray;
|
||||
result = _.collections.EmptyAssociativeArray();
|
||||
result.SetItem(P("title"), _.text.FromFormattedString(title));
|
||||
result.SetItem(P("difficulty"), _.text.FromString(difficulty));
|
||||
nextArray = _.collections.EmptyDynamicArray();
|
||||
local int i;
|
||||
local HashTable result;
|
||||
local HashTable nextPair;
|
||||
local ArrayList nextArray;
|
||||
|
||||
result = _.collections.EmptyHashTable();
|
||||
result.SetFormattedString(P("title"), title);
|
||||
result.SetString(P("difficulty"), difficulty);
|
||||
nextArray = _.collections.EmptyArrayList();
|
||||
for (i = 0; i < includeFeature.length; i += 1) {
|
||||
nextArray.AddItem(_.text.FromString(includeFeature[i]));
|
||||
nextArray.AddString(includeFeature[i]);
|
||||
}
|
||||
result.SetItem(P("includeFeature"), nextArray);
|
||||
nextArray = _.collections.EmptyDynamicArray();
|
||||
_.memory.Free(nextArray);
|
||||
nextArray = _.collections.EmptyArrayList();
|
||||
for (i = 0; i < excludeFeature.length; i += 1) {
|
||||
nextArray.AddItem(_.text.FromString(excludeFeature[i]));
|
||||
}
|
||||
result.SetItem(P("excludeFeature"), nextArray);
|
||||
nextArray = _.collections.EmptyDynamicArray();
|
||||
_.memory.Free(nextArray);
|
||||
nextArray = _.collections.EmptyArrayList();
|
||||
for (i = 0; i < includeMutator.length; i += 1) {
|
||||
nextArray.AddItem(_.text.FromString(includeFeature[i]));
|
||||
}
|
||||
result.SetItem(P("includeMutator"), nextArray);
|
||||
nextArray = _.collections.EmptyDynamicArray();
|
||||
_.memory.Free(nextArray);
|
||||
nextArray = _.collections.EmptyArrayList();
|
||||
for (i = 0; i < includeFeatureAs.length; i += 1)
|
||||
{
|
||||
nextPair = _.collections.EmptyAssociativeArray();
|
||||
nextPair.SetItem(P("feature"),
|
||||
_.text.FromString(includeFeatureAs[i].feature));
|
||||
nextPair.SetItem(P("config"),
|
||||
_.text.FromString(includeFeatureAs[i].config));
|
||||
nextPair = _.collections.EmptyHashTable();
|
||||
nextPair.SetString(P("feature"), includeFeatureAs[i].feature);
|
||||
nextPair.SetString(P("config"), includeFeatureAs[i].config);
|
||||
nextArray.AddItem(nextPair);
|
||||
_.memory.Free(nextPair);
|
||||
}
|
||||
result.SetItem(P("includeFeatureAs"), nextArray);
|
||||
_.memory.Free(nextArray);
|
||||
return result;
|
||||
}
|
||||
|
||||
protected function FromData(AssociativeArray source)
|
||||
protected function FromData(HashTable source)
|
||||
{
|
||||
local int i;
|
||||
local Text nextText;
|
||||
local DynamicArray includeFeatureAsSource;
|
||||
local int i;
|
||||
local ArrayList nextArray;
|
||||
local HashTable nextPair;
|
||||
if (source == none) {
|
||||
return;
|
||||
}
|
||||
nextText = source.GetText(P("title"));
|
||||
if (nextText != none) {
|
||||
title = nextText.ToFormattedString();
|
||||
}
|
||||
nextText = source.GetText(P("difficulty"));
|
||||
if (nextText != none) {
|
||||
difficulty = nextText.ToString();
|
||||
}
|
||||
includeFeature =
|
||||
DynamicIntoStringArray(source.GetDynamicArray(P("includeFeature")));
|
||||
excludeFeature =
|
||||
DynamicIntoStringArray(source.GetDynamicArray(P("excludeFeature")));
|
||||
includeMutator =
|
||||
DynamicIntoStringArray(source.GetDynamicArray(P("includeMutator")));
|
||||
includeFeatureAsSource = source.GetDynamicArray(P("includeFeatureAs"));
|
||||
if (includeFeatureAsSource == none) {
|
||||
title = source.GetFormattedString(P("title"));
|
||||
title = source.GetString(P("title"));
|
||||
nextArray = source.GetArrayList(P("includeFeature"));
|
||||
includeFeature = DynamicIntoStringArray(nextArray);
|
||||
_.memory.Free(nextArray);
|
||||
nextArray = source.GetArrayList(P("excludeFeature"));
|
||||
excludeFeature = DynamicIntoStringArray(nextArray);
|
||||
_.memory.Free(nextArray);
|
||||
nextArray = source.GetArrayList(P("includeMutator"));
|
||||
includeMutator = DynamicIntoStringArray(nextArray);
|
||||
_.memory.Free(nextArray);
|
||||
nextArray = source.GetArrayList(P("includeFeatureAs"));
|
||||
if (nextArray == none) {
|
||||
return;
|
||||
}
|
||||
includeFeatureAs.length = 0;
|
||||
for (i = 0; i < includeFeatureAsSource.GetLength(); i += 1)
|
||||
for (i = 0; i < nextArray.GetLength(); i += 1)
|
||||
{
|
||||
includeFeatureAs[i] = AssociativeArrayIntoPair(
|
||||
includeFeatureAsSource.GetAssociativeArray(i));
|
||||
nextPair = nextArray.GetHashTable(i);
|
||||
includeFeatureAs[i] = HashTableIntoPair(nextPair);
|
||||
_.memory.Free(nextPair);
|
||||
}
|
||||
_.memory.Free(nextArray);
|
||||
}
|
||||
|
||||
private final function FeatureConfigPair AssociativeArrayIntoPair(
|
||||
AssociativeArray source)
|
||||
private final function FeatureConfigPair HashTableIntoPair(HashTable source)
|
||||
{
|
||||
local Text nextText;
|
||||
local FeatureConfigPair result;
|
||||
@ -145,7 +147,7 @@ private final function FeatureConfigPair AssociativeArrayIntoPair(
|
||||
return result;
|
||||
}
|
||||
|
||||
private final function array<string> DynamicIntoStringArray(DynamicArray source)
|
||||
private final function array<string> DynamicIntoStringArray(ArrayList source)
|
||||
{
|
||||
local int i;
|
||||
local Text nextText;
|
||||
|
@ -54,72 +54,62 @@ protected function DefaultIt()
|
||||
option.length = 0;
|
||||
}
|
||||
|
||||
protected function AssociativeArray ToData()
|
||||
protected function HashTable ToData()
|
||||
{
|
||||
local int i;
|
||||
local AssociativeArray result;
|
||||
local AssociativeArray nextPair;
|
||||
local DynamicArray nextArray;
|
||||
local int i;
|
||||
local ArrayList nextArray;
|
||||
local HashTable result, nextPair;
|
||||
result = super.ToData();
|
||||
if (result == none) {
|
||||
return none;
|
||||
}
|
||||
result.SetItem(P("gameTypeClass"), _.text.FromString(gameTypeClass));
|
||||
result.SetItem(P("acronym"), _.text.FromString(acronym));
|
||||
result.SetItem(P("mapPrefix"), _.text.FromString(mapPrefix));
|
||||
nextArray = _.collections.EmptyDynamicArray();
|
||||
result.SetString(P("gameTypeClass"), gameTypeClass);
|
||||
result.SetString(P("acronym"), acronym);
|
||||
result.SetString(P("mapPrefix"), mapPrefix);
|
||||
nextArray = _.collections.EmptyArrayList();
|
||||
for (i = 0; i < option.length; i += 1)
|
||||
{
|
||||
nextPair = _.collections.EmptyAssociativeArray();
|
||||
nextPair.SetItem(P("key"), _.text.FromString(option[i].key));
|
||||
nextPair.SetItem(P("value"), _.text.FromString(option[i].value));
|
||||
nextPair = _.collections.EmptyHashTable();
|
||||
nextPair.SetString(P("key"), option[i].key);
|
||||
nextPair.SetString(P("value"), option[i].value);
|
||||
nextArray.AddItem(nextPair);
|
||||
_.memory.Free(nextPair);
|
||||
}
|
||||
result.SetItem(P("option"), nextArray);
|
||||
_.memory.Free(nextArray);
|
||||
return result;
|
||||
}
|
||||
|
||||
protected function FromData(AssociativeArray source)
|
||||
protected function FromData(HashTable source)
|
||||
{
|
||||
local int i;
|
||||
local Text nextText;
|
||||
local GameOption nextPair;
|
||||
local DynamicArray nextArray;
|
||||
local GameOption nextGameOption;
|
||||
local ArrayList nextArray;
|
||||
local HashTable nextPair;
|
||||
super.FromData(source);
|
||||
if (source == none) {
|
||||
return;
|
||||
}
|
||||
nextText = source.GetText(P("gameTypeClass"));
|
||||
if (nextText != none) {
|
||||
gameTypeClass = nextText.ToString();
|
||||
}
|
||||
nextText = source.GetText(P("acronym"));
|
||||
if (nextText != none) {
|
||||
acronym = nextText.ToString();
|
||||
}
|
||||
nextText = source.GetText(P("mapPrefix"));
|
||||
if (nextText != none) {
|
||||
mapPrefix = nextText.ToString();
|
||||
}
|
||||
nextArray = source.GetDynamicArray(P("option"));
|
||||
gameTypeClass = source.GetString(P("gameTypeClass"));
|
||||
acronym = source.GetString(P("acronym"));
|
||||
mapPrefix = source.GetString(P("mapPrefix"));
|
||||
nextArray = source.GetArrayList(P("option"));
|
||||
if (nextArray == none) {
|
||||
return;
|
||||
}
|
||||
option.length = 0;
|
||||
for (i = 0; i < nextArray.GetLength(); i += 1)
|
||||
{
|
||||
nextPair.key = "";
|
||||
nextPair.value = "";
|
||||
nextText = source.GetText(P("key"));
|
||||
if (nextText != none) {
|
||||
nextPair.key = nextText.ToString();
|
||||
nextPair = HashTable(nextArray.GetItem(i));
|
||||
if (nextPair == none) {
|
||||
continue;
|
||||
}
|
||||
nextText = source.GetText(P("value"));
|
||||
if (nextText != none) {
|
||||
nextPair.value = nextText.ToString();
|
||||
}
|
||||
option[option.length] = nextPair;
|
||||
nextGameOption.key = nextPair.GetString(P("key"));
|
||||
nextGameOption.value = nextPair.GetString(P("value"));
|
||||
option[option.length] = nextGameOption;
|
||||
_.memory.Free(nextPair);
|
||||
}
|
||||
_.memory.Free(nextArray);
|
||||
}
|
||||
|
||||
public function Text GetGameTypeClass()
|
||||
|
Reference in New Issue
Block a user