feat(enemy): sistema d'events declaratius via YAML
This commit is contained in:
@@ -0,0 +1,23 @@
|
||||
// enemy_event_dispatcher.hpp - Executa les accions YAML d'un event d'enemic
|
||||
// © 2026 JailDesigner
|
||||
//
|
||||
// Mira la llista d'EnemyAction associada a l'event al config de l'enemic i les
|
||||
// executa una per una. L'acció DESTROY dispara recursivament ON_DESTROY abans
|
||||
// de desactivar físicament l'enemic (el parser garanteix que ON_DESTROY no
|
||||
// conté DESTROY, evitant recursió infinita).
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <cstdint>
|
||||
|
||||
#include "game/entities/enemy_event.hpp"
|
||||
#include "game/systems/collision_system.hpp"
|
||||
|
||||
namespace Systems::EnemyEvents {
|
||||
|
||||
// shooter_id: id del jugador que ha disparat (0xFF = sense atribució).
|
||||
// bullet: punter opcional a la bala que ha causat l'event (usat per APPLY_IMPULSE);
|
||||
// nullptr per a events no derivats d'una bala (on_hurt_end).
|
||||
void dispatchEvent(Systems::Collision::Context& ctx, Enemy& enemy, EnemyEventType event, uint8_t shooter_id, const Bullet* bullet = nullptr);
|
||||
|
||||
} // namespace Systems::EnemyEvents
|
||||
Reference in New Issue
Block a user