reorganize BB file loading abstractions

This commit is contained in:
Martin Michelsen
2022-09-03 01:13:11 -07:00
parent 89285fef98
commit 9a35f5ca63
41 changed files with 870 additions and 607 deletions
+13 -6
View File
@@ -19,7 +19,8 @@ struct PlayerStats {
PlayerStats() noexcept;
} __attribute__((packed));
struct LevelTable { // from PlyLevelTbl.prs
class LevelTable { // from PlyLevelTbl.prs
public:
struct LevelStats {
uint8_t atp;
uint8_t mst;
@@ -34,12 +35,18 @@ struct LevelTable { // from PlyLevelTbl.prs
void apply(PlayerStats& ps) const;
} __attribute__((packed));
PlayerStats base_stats[12];
le_uint32_t unknown[12];
LevelStats levels[12][200];
struct Table {
PlayerStats base_stats[12];
le_uint32_t unknown[12];
LevelStats levels[12][200];
} __attribute__((packed));
LevelTable(const std::string& filename, bool compressed);
LevelTable(std::shared_ptr<const std::string> data, bool compressed);
const PlayerStats& base_stats_for_class(uint8_t char_class) const;
const LevelStats& stats_for_level(uint8_t char_class, uint8_t level) const;
} __attribute__((packed));
private:
std::shared_ptr<const std::string> data;
const Table* table;
};