Update CreatureLib.
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-05-27 17:26:25 +02:00
parent 0d111739f4
commit f42ce8865d
53 changed files with 316 additions and 269 deletions

View File

@@ -13,7 +13,8 @@ protected:
IPkmnBinaryStream(size_t angelScriptBound) : _angelScriptBound(angelScriptBound) {}
public:
virtual void WriteTypes(const Dictionary<ScriptCategory, Dictionary<ConstString, AngelScriptTypeInfo*>>& types) {
virtual void
WriteTypes(const ArbUt::Dictionary<ScriptCategory, ArbUt::Dictionary<ConstString, AngelScriptTypeInfo*>>& types) {
// We serialize our types in the format
// "[category(byte)][name(str)]\2[decl(str)]\2[name(str)]\2[decl(str)]\1[category(byte)]...."
@@ -37,9 +38,9 @@ public:
Write("\1", sizeof(char));
}
}
virtual Dictionary<ScriptCategory, Dictionary<ConstString, uint32_t>> ReadTypes() {
virtual ArbUt::Dictionary<ScriptCategory, ArbUt::Dictionary<ConstString, uint32_t>> ReadTypes() {
_angelScriptBound = SIZE_MAX;
Dictionary<ScriptCategory, Dictionary<ConstString, uint32_t>> types;
ArbUt::Dictionary<ScriptCategory, ArbUt::Dictionary<ConstString, uint32_t>> types;
ScriptCategory categoryArr[1];
while (true) {
// Every inner database starts with the category, of known size. Read that.
@@ -48,7 +49,7 @@ public:
if (read == 0) {
break;
}
Dictionary<ConstString, uint32_t> innerDb;
ArbUt::Dictionary<ConstString, uint32_t> innerDb;
// We don't know the sizes of the name and decl. Allocate 128 characters for them, as that should be enough.
char name[128];
@@ -67,8 +68,8 @@ public:
if (isDecl) {
// Insert the name and decl into the dictionary. Close off the decl with eof as well.
decl[pos] = '\0';
innerDb.Insert(Arbutils::CaseInsensitiveConstString(name),
Arbutils::CaseInsensitiveConstString::GetHash(decl));
innerDb.Insert(ArbUt::CaseInsensitiveConstString(name),
ArbUt::CaseInsensitiveConstString::GetHash(decl));
}
// If we have found \1, we are done with the current category, so break.
break;
@@ -79,8 +80,8 @@ public:
if (isDecl) {
// Insert the name and decl into the dictionary. Close off the decl with eof as well.
decl[pos] = '\0';
innerDb.Insert(Arbutils::CaseInsensitiveConstString(name),
Arbutils::CaseInsensitiveConstString::GetHash(decl));
innerDb.Insert(ArbUt::CaseInsensitiveConstString(name),
ArbUt::CaseInsensitiveConstString::GetHash(decl));
// Reset our position and toggle back to name.
pos = 0;
isDecl = false;