change repair_tool application and add beams for salvager and repair_tool

This commit is contained in:
2026-06-18 22:14:09 +02:00
parent 7924e037aa
commit 9573b9789a
37 changed files with 498 additions and 199 deletions

View File

@@ -0,0 +1,31 @@
#pragma once
#include "Event.h"
#include "Tick.h"
#include "entt/entity/entity.hpp"
// The kind of tool that produced a beam. Used by the renderer to choose the
// beam color (REQ-SHP-FIRING-BEAM).
enum class BeamKind
{
Weapon,
Repair,
Salvage,
};
// Transient record emitted whenever a weapon fires, a repair tool starts a heal
// cycle, or a salvage module starts a collection cycle (REQ-SHP-FIRING,
// REQ-SHP-FIRING-BEAM). Buffered in a sim-owned vector during the tick, then
// drained and re-emitted via EventManager by the UI frame handler.
struct BeamFiredEvent : public Event
{
BeamFiredEvent() = default;
BeamFiredEvent(BeamKind kind, entt::entity shooter, entt::entity target, Tick emittedAt)
: kind(kind), shooter(shooter), target(target), emittedAt(emittedAt) {}
BeamKind kind = BeamKind::Weapon;
entt::entity shooter = entt::null;
entt::entity target = entt::null;
Tick emittedAt = 0;
};

View File

@@ -23,7 +23,7 @@ SET(HDRS
${CMAKE_CURRENT_SOURCE_DIR}/InspectWindowClosedEvent.h
${CMAKE_CURRENT_SOURCE_DIR}/ArenaStartRequestedEvent.h
${CMAKE_CURRENT_SOURCE_DIR}/ArenaInspectRequestedEvent.h
${CMAKE_CURRENT_SOURCE_DIR}/WeaponFiredEvent.h
${CMAKE_CURRENT_SOURCE_DIR}/BeamFiredEvent.h
${CMAKE_CURRENT_SOURCE_DIR}/DebugDrawToggledEvent.h
PARENT_SCOPE
)

View File

@@ -1,17 +0,0 @@
#pragma once
#include "Event.h"
#include "Tick.h"
#include "entt/entity/entity.hpp"
struct WeaponFiredEvent : public Event
{
WeaponFiredEvent() = default;
WeaponFiredEvent(entt::entity shooter, entt::entity target, Tick emittedAt)
: shooter(shooter), target(target), emittedAt(emittedAt) {}
entt::entity shooter = entt::null;
entt::entity target = entt::null;
Tick emittedAt = 0;
};