the final rename
This commit is contained in:
+13
-13
@@ -1,16 +1,16 @@
|
||||
#include "Level.h"
|
||||
#include "World.h"
|
||||
#include "LevelEvents.h"
|
||||
#include "../content/Content.h"
|
||||
#include "../lighting/Lighting.h"
|
||||
#include "../voxels/Chunk.h"
|
||||
#include "../voxels/Chunks.h"
|
||||
#include "../voxels/ChunksStorage.h"
|
||||
#include "../physics/Hitbox.h"
|
||||
#include "../physics/PhysicsSolver.h"
|
||||
#include "../objects/Player.h"
|
||||
#include "../items/Inventory.h"
|
||||
#include "../items/Inventories.h"
|
||||
#include "Level.hpp"
|
||||
#include "World.hpp"
|
||||
#include "LevelEvents.hpp"
|
||||
#include "../content/Content.hpp"
|
||||
#include "../lighting/Lighting.hpp"
|
||||
#include "../voxels/Chunk.hpp"
|
||||
#include "../voxels/Chunks.hpp"
|
||||
#include "../voxels/ChunksStorage.hpp"
|
||||
#include "../physics/Hitbox.hpp"
|
||||
#include "../physics/PhysicsSolver.hpp"
|
||||
#include "../objects/Player.hpp"
|
||||
#include "../items/Inventory.hpp"
|
||||
#include "../items/Inventories.hpp"
|
||||
|
||||
Level::Level(World* world, const Content* content, EngineSettings& settings)
|
||||
: world(world),
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#ifndef WORLD_LEVEL_H_
|
||||
#define WORLD_LEVEL_H_
|
||||
#ifndef WORLD_LEVEL_HPP_
|
||||
#define WORLD_LEVEL_HPP_
|
||||
|
||||
#include "../settings.h"
|
||||
#include "../interfaces/Object.h"
|
||||
#include "../settings.hpp"
|
||||
#include "../interfaces/Object.hpp"
|
||||
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
@@ -69,4 +69,4 @@ public:
|
||||
}
|
||||
};
|
||||
|
||||
#endif /* WORLD_LEVEL_H_ */
|
||||
#endif /* WORLD_LEVEL_HPP_ */
|
||||
@@ -1,5 +1,5 @@
|
||||
#include "LevelEvents.h"
|
||||
#include "../voxels/Chunk.h"
|
||||
#include "LevelEvents.hpp"
|
||||
#include "../voxels/Chunk.hpp"
|
||||
|
||||
using std::vector;
|
||||
|
||||
@@ -13,4 +13,4 @@ void LevelEvents::trigger(lvl_event_type type, Chunk* chunk) {
|
||||
for (chunk_event_func func : callbacks) {
|
||||
func(type, chunk);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,23 +0,0 @@
|
||||
#ifndef WORLD_LEVEL_EVENTS_H_
|
||||
#define WORLD_LEVEL_EVENTS_H_
|
||||
|
||||
#include <functional>
|
||||
#include <vector>
|
||||
#include <unordered_map>
|
||||
|
||||
class Chunk;
|
||||
|
||||
enum lvl_event_type {
|
||||
EVT_CHUNK_HIDDEN,
|
||||
};
|
||||
|
||||
typedef std::function<void(lvl_event_type, Chunk*)> chunk_event_func;
|
||||
|
||||
class LevelEvents {
|
||||
std::unordered_map<lvl_event_type, std::vector<chunk_event_func>> chunk_callbacks;
|
||||
public:
|
||||
void listen(lvl_event_type type, chunk_event_func func);
|
||||
void trigger(lvl_event_type type, Chunk* chunk);
|
||||
};
|
||||
|
||||
#endif // WORLD_LEVEL_EVENTS_H_
|
||||
@@ -0,0 +1,23 @@
|
||||
#ifndef WORLD_LEVEL_EVENTS_HPP_
|
||||
#define WORLD_LEVEL_EVENTS_HPP_
|
||||
|
||||
#include <functional>
|
||||
#include <vector>
|
||||
#include <unordered_map>
|
||||
|
||||
class Chunk;
|
||||
|
||||
enum lvl_event_type {
|
||||
EVT_CHUNK_HIDDEN,
|
||||
};
|
||||
|
||||
typedef std::function<void(lvl_event_type, Chunk*)> chunk_event_func;
|
||||
|
||||
class LevelEvents {
|
||||
std::unordered_map<lvl_event_type, std::vector<chunk_event_func>> chunk_callbacks;
|
||||
public:
|
||||
void listen(lvl_event_type type, chunk_event_func func);
|
||||
void trigger(lvl_event_type type, Chunk* chunk);
|
||||
};
|
||||
|
||||
#endif // WORLD_LEVEL_EVENTS_HPP_
|
||||
+10
-10
@@ -1,16 +1,16 @@
|
||||
#include "World.h"
|
||||
#include "World.hpp"
|
||||
|
||||
#include "Level.h"
|
||||
#include "../content/Content.h"
|
||||
#include "Level.hpp"
|
||||
#include "../content/Content.hpp"
|
||||
#include "../content/ContentLUT.hpp"
|
||||
#include "../files/WorldFiles.h"
|
||||
#include "../items/Inventories.h"
|
||||
#include "../objects/Player.h"
|
||||
#include "../voxels/Chunk.h"
|
||||
#include "../voxels/Chunks.h"
|
||||
#include "../voxels/ChunksStorage.h"
|
||||
#include "../files/WorldFiles.hpp"
|
||||
#include "../items/Inventories.hpp"
|
||||
#include "../objects/Player.hpp"
|
||||
#include "../voxels/Chunk.hpp"
|
||||
#include "../voxels/Chunks.hpp"
|
||||
#include "../voxels/ChunksStorage.hpp"
|
||||
#include "../window/Camera.hpp"
|
||||
#include "../world/WorldGenerators.h"
|
||||
#include "../world/WorldGenerators.hpp"
|
||||
|
||||
#include <memory>
|
||||
#include <iostream>
|
||||
|
||||
@@ -1,17 +1,18 @@
|
||||
#ifndef WORLD_WORLD_H_
|
||||
#define WORLD_WORLD_H_
|
||||
#ifndef WORLD_WORLD_HPP_
|
||||
#define WORLD_WORLD_HPP_
|
||||
|
||||
#include "../typedefs.hpp"
|
||||
#include "../settings.hpp"
|
||||
#include "../util/timeutil.hpp"
|
||||
#include "../data/dynamic.hpp"
|
||||
#include "../interfaces/Serializable.hpp"
|
||||
#include "../content/ContentPack.hpp"
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <memory>
|
||||
#include <filesystem>
|
||||
#include <stdexcept>
|
||||
#include "../typedefs.h"
|
||||
#include "../settings.h"
|
||||
#include "../util/timeutil.h"
|
||||
#include "../data/dynamic.h"
|
||||
#include "../interfaces/Serializable.h"
|
||||
#include "../content/ContentPack.h"
|
||||
|
||||
class Content;
|
||||
class WorldFiles;
|
||||
@@ -147,4 +148,4 @@ public:
|
||||
void deserialize(dynamic::Map *src) override;
|
||||
};
|
||||
|
||||
#endif /* WORLD_WORLD_H_ */
|
||||
#endif /* WORLD_WORLD_HPP_ */
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "WorldGenerators.h"
|
||||
#include "../voxels/WorldGenerator.h"
|
||||
#include "../voxels/FlatWorldGenerator.h"
|
||||
#include "../content/Content.h"
|
||||
#include "WorldGenerators.hpp"
|
||||
#include "../voxels/WorldGenerator.hpp"
|
||||
#include "../voxels/FlatWorldGenerator.hpp"
|
||||
#include "../content/Content.hpp"
|
||||
#include <iostream>
|
||||
|
||||
std::vector<std::string> WorldGenerators::getGeneratorsIDs() {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
#ifndef WORLD_WORLDGENERATORS_H_
|
||||
#define WORLD_WORLDGENERATORS_H_
|
||||
#ifndef WORLD_WORLDGENERATORS_HPP_
|
||||
#define WORLD_WORLDGENERATORS_HPP_
|
||||
|
||||
#include "../voxels/WorldGenerator.h"
|
||||
#include "../content/Content.h"
|
||||
#include "../voxels/WorldGenerator.hpp"
|
||||
#include "../content/Content.hpp"
|
||||
#include <map>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
@@ -35,4 +35,4 @@ void WorldGenerators::addGenerator(std::string id) {
|
||||
};
|
||||
}
|
||||
|
||||
#endif /* WORLD_WORLDGENERATORS_H_ */
|
||||
#endif /* WORLD_WORLDGENERATORS_HPP_ */
|
||||
Reference in New Issue
Block a user