2023-06-30 14:34:39 -04:00
|
|
|
#include "mxvariabletable.h"
|
|
|
|
|
2023-11-21 03:44:45 -05:00
|
|
|
// OFFSET: LEGO1 0x100afcd0 TEMPLATE
|
|
|
|
// MxCollection<MxVariable *>::Compare
|
|
|
|
|
|
|
|
// OFFSET: LEGO1 0x100afce0 TEMPLATE
|
|
|
|
// MxCollection<MxVariable *>::~MxCollection<MxVariable *>
|
|
|
|
|
|
|
|
// OFFSET: LEGO1 0x100afd30 TEMPLATE
|
|
|
|
// MxCollection<MxVariable *>::Destroy
|
|
|
|
|
|
|
|
// OFFSET: LEGO1 0x100afd40 TEMPLATE
|
|
|
|
// MxCollection<MxVariable *>::`scalar deleting destructor'
|
|
|
|
|
|
|
|
// OFFSET: LEGO1 0x100afdb0 TEMPLATE
|
|
|
|
// MxVariableTable::Destroy
|
|
|
|
|
|
|
|
// OFFSET: LEGO1 0x100afdc0 TEMPLATE
|
|
|
|
// MxHashTable<MxVariable *>::Hash
|
|
|
|
|
|
|
|
// OFFSET: LEGO1 0x100b0bd0 TEMPLATE
|
|
|
|
// MxHashTable<MxVariable *>::~MxHashTable<MxVariable *>
|
|
|
|
|
|
|
|
// OFFSET: LEGO1 0x100b0ca0 TEMPLATE
|
|
|
|
// MxHashTable<MxVariable *>::`scalar deleting destructor'
|
|
|
|
|
2023-08-03 20:13:41 -04:00
|
|
|
// OFFSET: LEGO1 0x100b7330
|
2023-10-24 19:38:27 -04:00
|
|
|
MxS8 MxVariableTable::Compare(MxVariable* p_var0, MxVariable* p_var1)
|
2023-08-03 20:13:41 -04:00
|
|
|
{
|
2023-11-12 19:25:56 -05:00
|
|
|
return p_var0->GetKey()->Compare(*p_var1->GetKey());
|
2023-08-03 20:13:41 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
// OFFSET: LEGO1 0x100b7370
|
2023-10-24 19:38:27 -04:00
|
|
|
MxU32 MxVariableTable::Hash(MxVariable* p_var)
|
2023-08-03 20:13:41 -04:00
|
|
|
{
|
2023-10-24 19:38:27 -04:00
|
|
|
const char* str = p_var->GetKey()->GetData();
|
|
|
|
MxU32 value = 0;
|
2023-08-03 20:13:41 -04:00
|
|
|
|
2023-10-24 19:38:27 -04:00
|
|
|
for (int i = 0; str[i]; i++) {
|
|
|
|
value += str[i];
|
|
|
|
}
|
|
|
|
|
|
|
|
return value;
|
2023-08-03 20:13:41 -04:00
|
|
|
}
|
|
|
|
|
2023-06-30 14:34:39 -04:00
|
|
|
// OFFSET: LEGO1 0x100b73a0
|
2023-10-24 19:38:27 -04:00
|
|
|
void MxVariableTable::SetVariable(const char* p_key, const char* p_value)
|
2023-06-30 14:34:39 -04:00
|
|
|
{
|
2023-11-12 19:25:56 -05:00
|
|
|
MxHashTableCursor<MxVariable*> cursor(this);
|
2023-10-24 19:38:27 -04:00
|
|
|
MxVariable* var = new MxVariable(p_key, p_value);
|
2023-08-03 20:13:41 -04:00
|
|
|
|
2023-10-24 19:38:27 -04:00
|
|
|
if (cursor.Find(var)) {
|
|
|
|
delete var;
|
2023-11-12 19:25:56 -05:00
|
|
|
cursor.Current(var);
|
2023-10-24 19:38:27 -04:00
|
|
|
var->SetValue(p_value);
|
|
|
|
}
|
|
|
|
else {
|
2023-11-12 19:25:56 -05:00
|
|
|
MxHashTable<MxVariable*>::Add(var);
|
2023-10-24 19:38:27 -04:00
|
|
|
}
|
2023-06-30 14:34:39 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
// OFFSET: LEGO1 0x100b7740
|
2023-11-12 19:25:56 -05:00
|
|
|
void MxVariableTable::SetVariable(MxVariable* p_var)
|
2023-06-30 14:34:39 -04:00
|
|
|
{
|
2023-11-12 19:25:56 -05:00
|
|
|
MxHashTableCursor<MxVariable*> cursor(this);
|
|
|
|
MxBool found = cursor.Find(p_var);
|
2023-08-03 20:13:41 -04:00
|
|
|
|
2023-10-24 19:38:27 -04:00
|
|
|
if (found)
|
|
|
|
cursor.DeleteMatch();
|
2023-08-03 20:13:41 -04:00
|
|
|
|
2023-11-12 19:25:56 -05:00
|
|
|
MxHashTable<MxVariable*>::Add(p_var);
|
2023-06-30 14:34:39 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
// OFFSET: LEGO1 0x100b78f0
|
2023-10-24 19:38:27 -04:00
|
|
|
const char* MxVariableTable::GetVariable(const char* p_key)
|
2023-06-30 14:34:39 -04:00
|
|
|
{
|
2023-10-24 19:38:27 -04:00
|
|
|
const char* value = "";
|
2023-11-12 19:25:56 -05:00
|
|
|
MxHashTableCursor<MxVariable*> cursor(this);
|
2023-10-24 19:38:27 -04:00
|
|
|
MxVariable* var = new MxVariable(p_key);
|
|
|
|
|
|
|
|
MxBool found = cursor.Find(var);
|
|
|
|
delete var;
|
|
|
|
|
|
|
|
if (found) {
|
2023-11-12 19:25:56 -05:00
|
|
|
cursor.Current(var);
|
2023-10-24 19:38:27 -04:00
|
|
|
value = var->GetValue()->GetData();
|
|
|
|
}
|
2023-08-03 20:13:41 -04:00
|
|
|
|
2023-10-24 19:38:27 -04:00
|
|
|
return value;
|
2023-06-30 14:34:39 -04:00
|
|
|
}
|
2023-11-21 03:44:45 -05:00
|
|
|
|
|
|
|
// OFFSET: LEGO1 0x100b7ab0 TEMPLATE
|
|
|
|
// MxHashTable<MxVariable *>::Resize
|
|
|
|
|
|
|
|
// OFFSET: LEGO1 0x100b7b80 TEMPLATE
|
|
|
|
// MxHashTable<MxVariable *>::_NodeInsert
|