mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-10 13:31:49 +00:00
inventory regions, minor refactor
This commit is contained in:
parent
a57fba4fa4
commit
49fdcdfb27
29 changed files with 259 additions and 160 deletions
|
|
@ -8,7 +8,8 @@
|
|||
#include "../typedefs.h"
|
||||
#include "../settings.h"
|
||||
#include "../util/timeutil.h"
|
||||
|
||||
#include "../data/dynamic.h"
|
||||
#include "../interfaces/Serializable.h"
|
||||
#include "../content/ContentPack.h"
|
||||
|
||||
class Content;
|
||||
|
|
@ -25,12 +26,14 @@ public:
|
|||
world_load_error(std::string message);
|
||||
};
|
||||
|
||||
class World {
|
||||
class World : Serializable {
|
||||
std::string name;
|
||||
uint64_t seed;
|
||||
EngineSettings& settings;
|
||||
const Content* const content;
|
||||
std::vector<ContentPack> packs;
|
||||
|
||||
uint nextInventoryId = 1;
|
||||
public:
|
||||
WorldFiles* wfile;
|
||||
|
||||
|
|
@ -74,6 +77,13 @@ public:
|
|||
std::string getName() const;
|
||||
uint64_t getSeed() const;
|
||||
const std::vector<ContentPack>& getPacks() const;
|
||||
|
||||
std::unique_ptr<dynamic::Map> serialize() const override;
|
||||
void deserialize(dynamic::Map *src) override;
|
||||
|
||||
uint getNextInventoryId() {
|
||||
return nextInventoryId++;
|
||||
}
|
||||
};
|
||||
|
||||
#endif /* WORLD_WORLD_H_ */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue