mirror of https://github.com/OpenTTD/OpenTTD
Codechange: make StringParameters#next_type only writable from outside the class
parent
3e8f8c55c2
commit
01abcdfcac
|
@ -899,7 +899,7 @@ static void FormatString(StringBuilder &builder, const char *str_arg, StringPara
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
args.next_type = b;
|
args.SetTypeOfNextParameter(b);
|
||||||
switch (b) {
|
switch (b) {
|
||||||
case SCC_ENCODED: {
|
case SCC_ENCODED: {
|
||||||
uint64 sub_args_data[20];
|
uint64 sub_args_data[20];
|
||||||
|
|
|
@ -19,10 +19,11 @@ protected:
|
||||||
uint64 *data; ///< Array with the actual data.
|
uint64 *data; ///< Array with the actual data.
|
||||||
WChar *type; ///< Array with type information about the data. Can be nullptr when no type information is needed. See #StringControlCode.
|
WChar *type; ///< Array with type information about the data. Can be nullptr when no type information is needed. See #StringControlCode.
|
||||||
|
|
||||||
|
WChar next_type = 0; ///< The type of the next data that is retrieved.
|
||||||
|
|
||||||
public:
|
public:
|
||||||
size_t offset = 0; ///< Current offset in the data/type arrays.
|
size_t offset = 0; ///< Current offset in the data/type arrays.
|
||||||
size_t num_param; ///< Length of the data array.
|
size_t num_param; ///< Length of the data array.
|
||||||
WChar next_type = 0; ///< The type of the next data that is retrieved.
|
|
||||||
|
|
||||||
/** Create a new StringParameters instance. */
|
/** Create a new StringParameters instance. */
|
||||||
StringParameters(uint64 *data, size_t num_param, WChar *type) :
|
StringParameters(uint64 *data, size_t num_param, WChar *type) :
|
||||||
|
@ -57,6 +58,7 @@ public:
|
||||||
}
|
}
|
||||||
|
|
||||||
void ClearTypeInformation();
|
void ClearTypeInformation();
|
||||||
|
void SetTypeOfNextParameter(WChar type) { this->next_type = type; }
|
||||||
|
|
||||||
int64 GetInt64();
|
int64 GetInt64();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue