reorganize BB file loading abstractions
This commit is contained in:
+13
-6
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user