mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-07 12:01:50 +00:00
the final rename
This commit is contained in:
parent
f27a418dbe
commit
1627e21c1d
196 changed files with 836 additions and 815 deletions
23
src/world/LevelEvents.hpp
Normal file
23
src/world/LevelEvents.hpp
Normal file
|
|
@ -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_
|
||||
Loading…
Add table
Add a link
Reference in a new issue