mirror of
https://github.com/MihailRis/voxelcore.git
synced 2026-10-05 19:11:50 +00:00
migrate blocks interaction (scripting) to global chunks storage (WIP)
This commit is contained in:
parent
53cc8d3c7b
commit
e0b3425eff
16 changed files with 228 additions and 145 deletions
|
|
@ -4,14 +4,14 @@
|
|||
|
||||
using std::vector;
|
||||
|
||||
void LevelEvents::listen(lvl_event_type type, const chunk_event_func& func) {
|
||||
void LevelEvents::listen(LevelEventType type, const ChunkEventFunc& func) {
|
||||
auto& callbacks = chunk_callbacks[type];
|
||||
callbacks.push_back(func);
|
||||
}
|
||||
|
||||
void LevelEvents::trigger(lvl_event_type type, Chunk* chunk) {
|
||||
void LevelEvents::trigger(LevelEventType type, Chunk* chunk) {
|
||||
const auto& callbacks = chunk_callbacks[type];
|
||||
for (const chunk_event_func& func : callbacks) {
|
||||
for (const ChunkEventFunc& func : callbacks) {
|
||||
func(type, chunk);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue