|
|
@ -706,9 +706,7 @@ public final function bool GetBool(AcediaObject key, optional bool defaultValue) |
|
|
|
* recorded as either `BoolBox` or `BoolRef`, depending of `asRef` |
|
|
|
* recorded as either `BoolBox` or `BoolRef`, depending of `asRef` |
|
|
|
* optional parameter. |
|
|
|
* optional parameter. |
|
|
|
* |
|
|
|
* |
|
|
|
* @param key Key, at which to change the value. If `DynamicArray` is |
|
|
|
* @param key Key, at which to change the value. |
|
|
|
* not long enough to hold it, it will be automatically expanded. |
|
|
|
|
|
|
|
* If passed key is negative - method will do nothing. |
|
|
|
|
|
|
|
* @param value Value to be set at a given key. |
|
|
|
* @param value Value to be set at a given key. |
|
|
|
* @param asRef Given `bool` value will be recorded as immutable `BoolBox` |
|
|
|
* @param asRef Given `bool` value will be recorded as immutable `BoolBox` |
|
|
|
* by default (`asRef == false`). Setting this parameter to `true` will |
|
|
|
* by default (`asRef == false`). Setting this parameter to `true` will |
|
|
@ -775,9 +773,7 @@ public final function byte GetByte(AcediaObject key, optional byte defaultValue) |
|
|
|
* recorded as either `ByteBox` or `ByteBox`, depending of `asRef` |
|
|
|
* recorded as either `ByteBox` or `ByteBox`, depending of `asRef` |
|
|
|
* optional parameter. |
|
|
|
* optional parameter. |
|
|
|
* |
|
|
|
* |
|
|
|
* @param key Key, at which to change the value. If `DynamicArray` is |
|
|
|
* @param key Key, at which to change the value. |
|
|
|
* not long enough to hold it, it will be automatically expanded. |
|
|
|
|
|
|
|
* If passed key is negative - method will do nothing. |
|
|
|
|
|
|
|
* @param value Value to be set at a given key. |
|
|
|
* @param value Value to be set at a given key. |
|
|
|
* @param asRef Given `byte` value will be recorded as immutable `ByteBox` |
|
|
|
* @param asRef Given `byte` value will be recorded as immutable `ByteBox` |
|
|
|
* by default (`asRef == false`). Setting this parameter to `true` will |
|
|
|
* by default (`asRef == false`). Setting this parameter to `true` will |
|
|
@ -844,9 +840,7 @@ public final function int GetInt(AcediaObject key, optional int defaultValue) |
|
|
|
* recorded as either `IntBox` or `IntRef`, depending of `asRef` |
|
|
|
* recorded as either `IntBox` or `IntRef`, depending of `asRef` |
|
|
|
* optional parameter. |
|
|
|
* optional parameter. |
|
|
|
* |
|
|
|
* |
|
|
|
* @param key Key, at which to change the value. If `DynamicArray` is |
|
|
|
* @param key Key, at which to change the value. |
|
|
|
* not long enough to hold it, it will be automatically expanded. |
|
|
|
|
|
|
|
* If passed key is negative - method will do nothing. |
|
|
|
|
|
|
|
* @param value Value to be set at a given key. |
|
|
|
* @param value Value to be set at a given key. |
|
|
|
* @param asRef Given `int` value will be recorded as immutable `IntBox` |
|
|
|
* @param asRef Given `int` value will be recorded as immutable `IntBox` |
|
|
|
* by default (`asRef == false`). Setting this parameter to `true` will |
|
|
|
* by default (`asRef == false`). Setting this parameter to `true` will |
|
|
@ -915,15 +909,12 @@ public final function float GetFloat( |
|
|
|
* recorded as either `FloatBox` or `FloatRef`, depending of `asRef` |
|
|
|
* recorded as either `FloatBox` or `FloatRef`, depending of `asRef` |
|
|
|
* optional parameter. |
|
|
|
* optional parameter. |
|
|
|
* |
|
|
|
* |
|
|
|
* @param key Key, at which to change the value. If `DynamicArray` is |
|
|
|
* @param key Key, at which to change the value. |
|
|
|
* not long enough to hold it, it will be automatically expanded. |
|
|
|
|
|
|
|
* If passed key is negative - method will do nothing. |
|
|
|
|
|
|
|
* @param value Value to be set at a given key. |
|
|
|
* @param value Value to be set at a given key. |
|
|
|
* @param asRef Given `float` value will be recorded as immutable `FloatBox` |
|
|
|
* @param asRef Given `float` value will be recorded as immutable `FloatBox` |
|
|
|
* by default (`asRef == false`). Setting this parameter to `true` will |
|
|
|
* by default (`asRef == false`). Setting this parameter to `true` will |
|
|
|
* make this method record it as a mutable `FloatRef`. |
|
|
|
* make this method record it as a mutable `FloatRef`. |
|
|
|
* @return Reference to the caller `HashTable` to allow for |
|
|
|
* @return Reference to the caller `HashTable` to allow for method chaining. |
|
|
|
* method chaining. |
|
|
|
|
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public final function HashTable SetFloat( |
|
|
|
public final function HashTable SetFloat( |
|
|
|
AcediaObject key, |
|
|
|
AcediaObject key, |
|
|
@ -944,53 +935,46 @@ public final function HashTable SetFloat( |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Returns `string` item at key `key`. If key is invalid or |
|
|
|
* Returns plain string item at key `key`. If key is invalid or stores |
|
|
|
* stores a non-`Text`/`MutableText` value, returns `defaultValue`. |
|
|
|
* a non-`BaseText` value, returns `defaultValue`. |
|
|
|
* |
|
|
|
* |
|
|
|
* Referred value must be stored as `Text` or `MutableText` |
|
|
|
* Referred value must be stored as `Text` or `MutableText` (or one of their |
|
|
|
* (or one of their sub-classes) for this method to work. |
|
|
|
* sub-classes) for this method to work. |
|
|
|
* |
|
|
|
* |
|
|
|
* @param key Key of a `string` item that `HashTable` has to |
|
|
|
* @param key Key of a `string` item that `HashTable` has to |
|
|
|
* return. |
|
|
|
* return. |
|
|
|
* @param defaultValue Value to return if there is either no item recorded |
|
|
|
* @param defaultValue Value to return if there is either no item recorded |
|
|
|
* at `key` or it has a wrong type. |
|
|
|
* at `key` or it has a wrong type. |
|
|
|
* @return `string` value at `key` in the caller `HashTable`. |
|
|
|
* @return Plain string value at `key` in the caller `HashTable`. |
|
|
|
* `defaultValue` if passed `key` is invalid or non-`Text`/`MutableText` |
|
|
|
* `defaultValue` if passed `key` is invalid or non-`BaseText` value is |
|
|
|
* value is stored with it. |
|
|
|
* stored with it. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
public final function string GetString( |
|
|
|
public final function string GetString( |
|
|
|
AcediaObject key, |
|
|
|
AcediaObject key, |
|
|
|
optional string defaultValue) |
|
|
|
optional string defaultValue) |
|
|
|
{ |
|
|
|
{ |
|
|
|
local AcediaObject result; |
|
|
|
local AcediaObject result; |
|
|
|
local Text asText; |
|
|
|
local BaseText asText; |
|
|
|
local MutableText asMutableText; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result = BorrowItem(key); |
|
|
|
result = BorrowItem(key); |
|
|
|
if (result == none) { |
|
|
|
if (result == none) { |
|
|
|
return defaultValue; |
|
|
|
return defaultValue; |
|
|
|
} |
|
|
|
} |
|
|
|
asText = Text(result); |
|
|
|
asText = BaseText(result); |
|
|
|
if (asText != none) { |
|
|
|
if (asText != none) { |
|
|
|
return asText.ToString(); |
|
|
|
return asText.ToString(); |
|
|
|
} |
|
|
|
} |
|
|
|
asMutableText = MutableText(result); |
|
|
|
|
|
|
|
if (asMutableText != none) { |
|
|
|
|
|
|
|
return asMutableText.ToString(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return defaultValue; |
|
|
|
return defaultValue; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Changes `HashTable`'s value at key `key` to `value` that will be |
|
|
|
* Changes `HashTable`'s value at key `key` to plain string `value` that will |
|
|
|
* recorded as either `Text` or `MutableText`, depending of `asMutable` |
|
|
|
* be recorded as either `Text` or `MutableText`, depending of `asMutable` |
|
|
|
* optional parameter. |
|
|
|
* optional parameter. |
|
|
|
* |
|
|
|
* |
|
|
|
* @param key Key, at which to change the value. If `DynamicArray` is |
|
|
|
* @param key Key, at which to change the value. |
|
|
|
* not long enough to hold it, it will be automatically expanded. |
|
|
|
|
|
|
|
* If passed key is negative - method will do nothing. |
|
|
|
|
|
|
|
* @param value Value to be set at a given key. |
|
|
|
* @param value Value to be set at a given key. |
|
|
|
* @param asMutable Given `float` value will be recorded as immutable |
|
|
|
* @param asMutable Given plain string value will be recorded as immutable |
|
|
|
* `Text` by default (`asMutable == false`). Setting this parameter to |
|
|
|
* `Text` by default (`asMutable == false`). Setting this parameter to |
|
|
|
* `true` will make this method record it as a mutable `MutableText`. |
|
|
|
* `true` will make this method record it as a mutable `MutableText`. |
|
|
|
* @return Reference to the caller `HashTable` to allow for |
|
|
|
* @return Reference to the caller `HashTable` to allow for |
|
|
@ -1014,6 +998,71 @@ public final function HashTable SetString( |
|
|
|
return self; |
|
|
|
return self; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Returns formatted string item at key `key`. If key is invalid or stores |
|
|
|
|
|
|
|
* a non-`BaseText` value, returns `defaultValue`. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* Referred value must be stored as `Text` or `MutableText` (or one of their |
|
|
|
|
|
|
|
* sub-classes) for this method to work. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param key Key of a `string` item that `HashTable` has to |
|
|
|
|
|
|
|
* return. |
|
|
|
|
|
|
|
* @param defaultValue Value to return if there is either no item recorded |
|
|
|
|
|
|
|
* at `key` or it has a wrong type. |
|
|
|
|
|
|
|
* @return Formatted string value at `key` in the caller `HashTable`. |
|
|
|
|
|
|
|
* `defaultValue` if passed `key` is invalid or non-`BaseText` value is |
|
|
|
|
|
|
|
* stored with it. |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public final function string GetFormattedString( |
|
|
|
|
|
|
|
AcediaObject key, |
|
|
|
|
|
|
|
optional string defaultValue) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
local AcediaObject result; |
|
|
|
|
|
|
|
local BaseText asText; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
result = BorrowItem(key); |
|
|
|
|
|
|
|
if (result == none) { |
|
|
|
|
|
|
|
return defaultValue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
asText = BaseText(result); |
|
|
|
|
|
|
|
if (asText != none) { |
|
|
|
|
|
|
|
return asText.ToFormattedString(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return defaultValue; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
|
|
|
* Changes `HashTable`'s value at key `key` to formatted string `value` that |
|
|
|
|
|
|
|
* will be recorded as either `Text` or `MutableText`, depending of `asMutable` |
|
|
|
|
|
|
|
* optional parameter. |
|
|
|
|
|
|
|
* |
|
|
|
|
|
|
|
* @param key Key, at which to change the value. |
|
|
|
|
|
|
|
* @param value Value to be set at a given key. |
|
|
|
|
|
|
|
* @param asMutable Given formatted string value will be recorded as |
|
|
|
|
|
|
|
* immutable `Text` by default (`asMutable == false`). Setting this |
|
|
|
|
|
|
|
* parameter to `true` will make this method record it as a mutable |
|
|
|
|
|
|
|
* `MutableText`. |
|
|
|
|
|
|
|
* @return Reference to the caller `HashTable` to allow for |
|
|
|
|
|
|
|
* method chaining. |
|
|
|
|
|
|
|
*/ |
|
|
|
|
|
|
|
public final function HashTable SetFormattedString( |
|
|
|
|
|
|
|
AcediaObject key, |
|
|
|
|
|
|
|
string value, |
|
|
|
|
|
|
|
optional bool asMutable) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
local AcediaObject newValue; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (asMutable) { |
|
|
|
|
|
|
|
newValue = _.text.FromFormattedStringM(value); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
else { |
|
|
|
|
|
|
|
newValue = _.text.FromFormattedString(value); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
SetItem(key, newValue); |
|
|
|
|
|
|
|
newValue.FreeSelf(); |
|
|
|
|
|
|
|
return self; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* Returns `Text` item stored at key `key`. If key is invalid or |
|
|
|
* Returns `Text` item stored at key `key`. If key is invalid or |
|
|
|
* stores a non-`Text` value, returns `none`. |
|
|
|
* stores a non-`Text` value, returns `none`. |
|
|
|