Olympe Engine 2.0
2D Game Engine with ECS Architecture
Loading...
Searching...
No Matches
WorldBridge.cpp
Go to the documentation of this file.
1/*
2 * Olympe Blueprint Editor - World Bridge
3 *
4 * Provides hooks between World ECS and Blueprint Editor
5 * Allows World to notify editor of entity/component changes without direct dependency
6 */
7
8#include "WorldBridge.h"
9#include "BlueprintEditor.h"
11#include "InspectorPanel.h"
12#include "NodeGraphPanel.h"
13#include "../ECS_Entity.h"
14#include "../TaskSystem/LocalBlackboard.h"
15#include "../TaskSystem/TaskSystem.h"
16#include "../TaskSystem/TaskExecutionBridge.h"
17#include <cstdint> // Pour uint64_t
18
19// Bridge functions called by World (via extern declarations)
20// These avoid circular dependencies between World and BlueprintEditor
21
22extern "C" void NotifyEditorEntityCreated(uint64_t entity)
23{
24 // Notify BlueprintEditor backend (for Asset Browser runtime entities)
26
27 // Also notify EntityInspectorManager (for Inspector panel)
28 if (Olympe::EntityInspectorManager::Get().IsInitialized())
29 {
31 }
32}
33
35{
36 // Notify BlueprintEditor backend
38
39 // Also notify EntityInspectorManager
40 if (Olympe::EntityInspectorManager::Get().IsInitialized())
41 {
43 }
44}
45
46namespace Olympe
47{
48
49// Static frame-local copy of the blackboard snapshot published by the bridge.
50// InspectorPanel holds a non-owning pointer to this instance.
52
53// ---------------------------------------------------------------------------
54// Editor-side BB hook called by TaskExecutionBridge
55// ---------------------------------------------------------------------------
57{
58 if (bb != nullptr)
59 {
62 }
63 else
64 {
66 }
67}
68
69/**
70 * @brief Registers the TaskExecutionBridge with TaskSystem.
71 *
72 * Call once during editor startup so that TaskSystem publishes live state
73 * to the editor panels (NodeGraphPanel active-node highlight and
74 * InspectorPanel live blackboard display) each frame.
75 */
83
84/**
85 * @brief Unregisters the TaskExecutionBridge so that TaskSystem no longer
86 * publishes live state to the editor panels after shutdown.
87 */
92
93} // namespace Olympe
ComponentTypeID GetComponentTypeID_Static()
Definition ECS_Entity.h:56
std::uint64_t EntityID
Definition ECS_Entity.h:21
void NotifyEditorEntityCreated(uint64_t entity)
void NotifyEditorEntityDestroyed(uint64_t entity)
void NotifyEntityDestroyed(uint64_t entityId)
void NotifyEntityCreated(uint64_t entityId)
static BlueprintEditor & Get()
static EntityInspectorManager & Get()
static void SetDebugBlackboard(const LocalBlackboard *bb)
Register a live LocalBlackboard to display in the inspector.
Simple map-based blackboard for task graph runtime state.
static void SetActiveDebugNode(int localNodeId)
Set the local node ID that is currently executing.
static void Uninstall()
Uninstall the bridge.
static void Install(BridgeSetNodeFn nodeFn, BridgeSetBBFn bbFn)
Install the bridge and register Editor-side hooks.
< Provides AssetID and INVALID_ASSET_ID
static LocalBlackboard s_FrameBlackboard
void WorldBridge_UnregisterTaskCallback()
Unregisters the TaskExecutionBridge so that TaskSystem no longer publishes live state to the editor p...
void WorldBridge_RegisterTaskCallback()
Registers the TaskExecutionBridge with TaskSystem.
static void WorldBridge_SetBlackboard(const LocalBlackboard *bb)