Optimize Auto Databank code

This commit is contained in:
nastys
2025-03-05 21:49:41 +01:00
parent cf26061123
commit b20fc255dc
3 changed files with 35 additions and 52 deletions
+4 -16
View File
@@ -1,7 +1,5 @@
#pragma once
#include <chrono>
#include <set>
#include <vector>
#include <map>
#include "databank.h"
@@ -9,31 +7,21 @@ namespace Databank
{
struct PvEntry
{
int id = -1;
int unk1 = 1;
int unk2 = 0;
std::string advStart, advEnd, start, end;
bool operator<(const PvEntry& other) const
{
return id < other.id;
}
};
class PvList
{
protected:
std::set<PvEntry> entries;
std::map<int, PvEntry> entries;
public:
std::string finalString = std::string();
//std::string checksum = std::string();
bool readFromStr(std::string& str);
bool readFromFile(const std::string& filename);
bool finalize();
void copyCstrData(char* dst);
void addEntry(PvEntry& entry);
void addEntry(int id, PvEntry& entry);
void generateMissingEntries();
std::string finalize();
};
}