mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-10 21:41:50 +00:00
cleanup World references
This commit is contained in:
parent
ac00c561ee
commit
c73b036099
18 changed files with 45 additions and 45 deletions
|
|
@ -71,12 +71,12 @@ Level::Level(
|
|||
|
||||
Level::~Level() = default;
|
||||
|
||||
World* Level::getWorld() {
|
||||
return world.get();
|
||||
World& Level::getWorld() {
|
||||
return *world;
|
||||
}
|
||||
|
||||
const World* Level::getWorld() const {
|
||||
return world.get();
|
||||
const World& Level::getWorld() const {
|
||||
return *world;
|
||||
}
|
||||
|
||||
void Level::onSave() {
|
||||
|
|
|
|||
|
|
@ -46,9 +46,9 @@ public:
|
|||
);
|
||||
~Level();
|
||||
|
||||
World* getWorld();
|
||||
World& getWorld();
|
||||
|
||||
const World* getWorld() const;
|
||||
const World& getWorld() const;
|
||||
|
||||
void onSave();
|
||||
|
||||
|
|
|
|||
|
|
@ -147,7 +147,7 @@ std::unique_ptr<Level> World::load(
|
|||
|
||||
if (!playerRoot["players"].empty()) {
|
||||
if (!playerRoot["players"][0].has("id")) {
|
||||
level->getWorld()->getInfo().nextPlayerId++;
|
||||
level->getWorld().getInfo().nextPlayerId++;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,6 +67,8 @@ public:
|
|||
const std::vector<ContentPack>& packs
|
||||
);
|
||||
|
||||
World(const World&) = delete;
|
||||
|
||||
~World();
|
||||
|
||||
/// @brief Update world day-time and total time
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue