mitiru::bridge

Signal-only bridge between C++ gameplay and the CEF UI layer. Defines the JS-to-C++ and C++-to-JS message types and the registry for view-push handlers.

Signal-only bridge between C++ gameplay and the CEF UI layer. Defines the JS-to-C++ and C++-to-JS message types and the registry for view-push handlers.

NameKindItems
AiStateenum5
UtilityResultstruct3
AiBridgeclass17
AnimationBridgeclass8
BridgeEventBusGlueclass9
BridgeViewPushclass11
DebugDrawBridgeclass10
DialogueBacklogEntrystruct3
DialogueBridgeclass12
EventBridgeclass5
I18nBridgeclass6
ParticleBridgeclass8
PhysicsBodyEntrystruct1
CollisionEventstruct3
PhysicsBridgeclass19
ProceduralBridgeclass6
FullScreenVertexstruct4
Renderer3DBridgeclass11
SaveBridgeclass7
SteeringBridgeclass11
TilemapBridgeclass6
TransitionBridgeclass10
WidgetTypeenum3
UiWidgetInfostruct3
UiWidgetStatestruct16
UiBridgeclass12
VNBridgeclass16
enum AiState 5
Idle
Running
Success
Failure
using AiContext = sgc::bt::Blackboard;
struct UtilityResult 3
std::string actionName
float score = 0.0f
std::size_t index = 0
class AiBridge 17
void registerBehaviorTree(const std::string& name, std::unique_ptr<sgc::bt::Node> rootNode)
void registerBehaviorTree(const std::string& name, std::nullptr_t)
void unregisterBehaviorTree(const std::string& name)
AiState tickTree(const std::string& name, sgc::bt::Blackboard& blackboard)
[[nodiscard]] AiState getTreeState(const std::string& name) const
void setState(const std::string& name, AiState state)
[[nodiscard]] AiState getState(const std::string& name) const
[[nodiscard]] std::vector<std::string> registeredNames() const
[[nodiscard]] std::vector<std::string> registeredTreeNames() const
void registerUtilityAI(const std::string& name, sgc::ai::UtilitySelector<AiContext> selector)
void unregisterUtilityAI(const std::string& name)
[[nodiscard]] std::optional<UtilityResult> selectBestAction( const std::string& name, const AiContext& context) const
[[nodiscard]] std::vector<UtilityResult> evaluateAllActions( const std::string& name, const AiContext& context) const
[[nodiscard]] std::optional<sgc::ai::AStarResult<sgc::ai::GridPos>> findPath( const sgc::ai::GridGraph& grid, const sgc::ai::GridPos& start, const sgc::ai::GridPos& goal, std::size_t maxIterations = 10000) const
void addGoapAction(const sgc::ai::GOAPAction& action)
[[nodiscard]] auto planGoap( const sgc::ai::WorldState& current, const sgc::ai::WorldState& goal) const
[[nodiscard]] std::string toJson() const
class AnimationBridge 8
void setViewPush(BridgeViewPush* viewPush) noexcept
void addTween(const std::string& name, sgc::Tween<float> tween)
void update(float dt)
[[nodiscard]] float getTweenValue(const std::string& name) const
[[nodiscard]] bool isTweenComplete(const std::string& name) const
void removeTween(const std::string& name)
[[nodiscard]] std::size_t tweenCount() const noexcept
[[nodiscard]] std::string toJson() const
class BridgeEventBusGlue 9
BridgeEventBusGlue(mitiru::input::BridgeActionRouter& router, mitiru::EventBus& bus) noexcept
~BridgeEventBusGlue()
BridgeEventBusGlue(const BridgeEventBusGlue&) = delete
BridgeEventBusGlue& operator=(const BridgeEventBusGlue&) = delete
BridgeEventBusGlue(BridgeEventBusGlue&&) = delete
BridgeEventBusGlue& operator=(BridgeEventBusGlue&&) = delete
template <typename Event> void mapSignal(std::string signalName, std::function<Event(std::string_view)> builder)
template <typename Event> void mapSignalToTrivial(std::string signalName)
void unmap(std::string_view signalName)
class BridgeViewPush 11
`using SetSink = std::function<void(std::string_view key, std::string_view jsonValue)>;`
`using EmitSink = std::function<void(std::string_view key, std::string_view jsonPayload)>;`
BridgeViewPush(std::string subsystem, SetSink setSink, EmitSink emitSink)
BridgeViewPush(const BridgeViewPush&) = delete
BridgeViewPush& operator=(const BridgeViewPush&) = delete
BridgeViewPush(BridgeViewPush&&) = default
BridgeViewPush& operator=(BridgeViewPush&&) = default
void set(std::string_view key, std::string_view jsonValue)
void emit(std::string_view key, std::string_view jsonPayload)
[[nodiscard]] std::string_view subsystem() const noexcept
[[nodiscard]] std::string_view keyPrefix() const noexcept
class DebugDrawBridge 10
void drawRect(const sgc::AABB2f& rect, const sgc::Colorf& color, float thickness = 1.0f)
void drawCircle(const sgc::Vec2f& center, float radius, const sgc::Colorf& color)
void drawLine(const sgc::Vec2f& from, const sgc::Vec2f& to, const sgc::Colorf& color)
void drawArrow(const sgc::Vec2f& from, const sgc::Vec2f& to, const sgc::Colorf& color)
void drawPath(const std::vector<sgc::Vec2f>& points, const sgc::Colorf& color)
void flush(sgc::IRenderer& renderer)
void setEnabled(bool enabled)
[[nodiscard]] bool isEnabled() const noexcept
[[nodiscard]] std::size_t pendingCount() const noexcept
[[nodiscard]] std::string toJson() const
struct DialogueBacklogEntry 3
std::string speaker
std::string text
std::string choiceMade
class DialogueBridge 12
void setViewPush(BridgeViewPush* viewPush) noexcept
void loadDialogue(sgc::dialogue::DialogueGraph graph)
void startDialogue(const std::string& startNodeId)
void advance()
[[nodiscard]] std::string currentText() const
[[nodiscard]] std::string currentSpeaker() const
[[nodiscard]] std::vector<std::string> currentChoices() const
void selectChoice(int index)
[[nodiscard]] bool isActive() const noexcept
[[nodiscard]] const std::deque<DialogueBacklogEntry>& backlog() const noexcept
[[nodiscard]] std::size_t backlogSize() const noexcept
[[nodiscard]] std::string toJson() const
class EventBridge 5
template <typename T> void emit(const T& event)
template <typename T> sgc::ListenerId on(std::function<void(const T&)> handler)
void off(sgc::ListenerId listenerId)
[[nodiscard]] const sgc::EventDispatcher& dispatcher() const noexcept
[[nodiscard]] std::string toJson() const
class I18nBridge 6
void loadLanguage(const std::string& langCode, sgc::i18n::StringTable table)
void setCurrentLanguage(const std::string& langCode)
[[nodiscard]] std::string translate(const std::string& key) const
[[nodiscard]] std::string currentLanguage() const
[[nodiscard]] std::vector<std::string> availableLanguages() const
[[nodiscard]] std::string toJson() const
class ParticleBridge 8
void setViewPush(BridgeViewPush* viewPush) noexcept
void addSystem(const std::string& name, const sgc::EmitterConfig& config, std::size_t maxParticles = 1000)
void emit(const std::string& name, int count)
void update(float dt)
void removeSystem(const std::string& name)
[[nodiscard]] std::size_t activeParticleCount(const std::string& name) const
[[nodiscard]] std::size_t systemCount() const noexcept
[[nodiscard]] std::string toJson() const
struct PhysicsBodyEntry 1
sgc::physics::RigidBody2Df* body = nullptr
struct CollisionEvent 3
std::string labelA
std::string labelB
sgc::physics::CollisionResult2Df result
class PhysicsBridge 19
explicit PhysicsBridge(double stepSize = 1.0 / 60.0)
void addBody(const std::string& label, sgc::physics::RigidBody2Df* body, const sgc::Vec2f& halfSize)
void removeBody(const std::string& label)
[[nodiscard]] const PhysicsBodyEntry* getBody(const std::string& label) const
[[nodiscard]] std::size_t bodyCount() const noexcept
void setGravity(const sgc::Vec2f& gravity) noexcept
[[nodiscard]] const sgc::Vec2f& gravity() const noexcept
int step(double dt)
template <std::invocable<double> Callback> int step(double dt, Callback&& callback)
void setCollisionCallback(std::function<void(const CollisionEvent&)> callback)
[[nodiscard]] const std::vector<CollisionEvent>& lastCollisions() const noexcept
[[nodiscard]] std::optional<std::pair<std::string, sgc::physics::RayCastHit2Df>> rayCast( const sgc::Vec2f& origin, const sgc::Vec2f& direction, float maxDistance = 1e10f) const
void resetAccumulator() noexcept
[[nodiscard]] double stepSize() const noexcept
void setStepSize(double stepSize) noexcept
[[nodiscard]] double interpolationFactor() const noexcept
[[nodiscard]] int totalSteps() const noexcept
void setMaxSteps(int steps) noexcept
[[nodiscard]] std::string toJson() const
class ProceduralBridge 6
[[nodiscard]] sgc::procedural::DungeonResult generateDungeon( const sgc::procedural::DungeonConfig& config, uint32_t seed = 0)
[[nodiscard]] sgc::procedural::TerrainResult generateTerrain( const sgc::procedural::TerrainConfig& config, uint32_t seed = 0)
[[nodiscard]] sgc::procedural::WFCResult solveWFC(const sgc::procedural::WFCConfig& config)
[[nodiscard]] std::string generateLSystem(const sgc::procedural::LSystemConfig& config)
[[nodiscard]] sgc::procedural::TurtleResult interpretTurtle( const std::string& lString, const sgc::procedural::TurtleConfig& config)
[[nodiscard]] std::string toJson() const
struct FullScreenVertex 4
float x
float y
float u
float v
class Renderer3DBridge 11
Renderer3DBridge(mitiru::Screen& screen, gfx::IDevice* device) noexcept
[[nodiscard]] render::Texture toTexture() const
[[nodiscard]] std::unique_ptr<gfx::IBuffer> createQuadVertexBuffer() const
[[nodiscard]] std::unique_ptr<gfx::IBuffer> uploadPixelsAsBuffer() const
void updatePixelBuffer(gfx::IBuffer& buffer) const
[[nodiscard]] mitiru::Screen& screen() noexcept
[[nodiscard]] const mitiru::Screen& screen() const noexcept
[[nodiscard]] gfx::IDevice* device() const noexcept
void setDevice(gfx::IDevice* device) noexcept
[[nodiscard]] bool isReady() const noexcept
[[nodiscard]] std::string toJson() const
class SaveBridge 7
void save(int slot, const std::string& data)
[[nodiscard]] std::string load(int slot) const
[[nodiscard]] bool exists(int slot) const
void deleteSave(int slot)
[[nodiscard]] std::vector<int> listSlots() const
[[nodiscard]] std::size_t slotCount() const noexcept
[[nodiscard]] std::string toJson() const
class SteeringBridge 11
using Agent = sgc::ai::SteeringAgent<float>;
void addAgent(const std::string& name, Agent agent)
void removeAgent(const std::string& name)
void applySteering(const std::string& name, const sgc::Vec2f& force, float dt)
[[nodiscard]] sgc::Vec2f seek(const std::string& agentName, const sgc::Vec2f& target) const
[[nodiscard]] sgc::Vec2f flee(const std::string& agentName, const sgc::Vec2f& threat) const
[[nodiscard]] sgc::Vec2f arrive(const std::string& agentName, const sgc::Vec2f& target, float slowingRadius) const
[[nodiscard]] sgc::Vec2f flock(const std::string& agentName, float neighborRadius, const sgc::ai::FlockWeights& weights = {}) const
[[nodiscard]] const Agent* getAgent(const std::string& name) const
[[nodiscard]] std::size_t agentCount() const noexcept
[[nodiscard]] std::string toJson() const
class TilemapBridge 6
void create(const std::string& name, int width, int height, int tileSize)
void setTile(const std::string& name, int x, int y, int tileId)
[[nodiscard]] int getTile(const std::string& name, int x, int y) const
void removeTilemap(const std::string& name)
[[nodiscard]] std::size_t tilemapCount() const noexcept
[[nodiscard]] std::string toJson() const
class TransitionBridge 10
void setViewPush(BridgeViewPush* viewPush) noexcept
void startFadeOut(float duration)
void startFadeIn(float duration)
void update(float dt)
[[nodiscard]] float alpha() const noexcept
[[nodiscard]] bool isActive() const noexcept
[[nodiscard]] bool isComplete() const noexcept
[[nodiscard]] sgc::TransitionPhase phase() const noexcept
void reset() noexcept
[[nodiscard]] std::string toJson() const
enum WidgetType 3
Button
Slider
Checkbox
struct UiWidgetInfo 3
std::string name
std::string type
bool visible = true
struct UiWidgetState 16
std::string id
WidgetType type = WidgetType::Button
sgc::Rectf bounds
bool visible = true
bool enabled = true
sgc::ui::WidgetState visualState = sgc::ui::WidgetState::Normal
std::string label
bool clicked = false
float sliderValue = 0.0f
float sliderMin = 0.0f
float sliderMax = 1.0f
bool sliderDragging = false
bool sliderChanged = false
bool checked = false
bool toggled = false
std::string legacyType
class UiBridge 12
void addWidget(UiWidgetInfo widget)
void addButton(const std::string& id, const sgc::Rectf& bounds, const std::string& label)
void addSlider(const std::string& id, const sgc::Rectf& bounds, float minVal, float maxVal, float value)
void addCheckbox(const std::string& id, const sgc::Rectf& bounds, bool checked)
void removeWidget(const std::string& id)
[[nodiscard]] const UiWidgetState* getWidget(const std::string& id) const
[[nodiscard]] UiWidgetState* getWidget(const std::string& id)
[[nodiscard]] std::size_t widgetCount() const noexcept
void clear() noexcept
void processInput(const InputState& input)
void render(Screen& screen) const
[[nodiscard]] std::string toJson() const
class VNBridge 16
void setViewPush(BridgeViewPush* viewPush) noexcept
void loadScene(sgc::vn::VNScene scene)
void start()
void update(float dt, bool advancePressed, bool skipPressed)
[[nodiscard]] sgc::vn::VNPhase phase() const
[[nodiscard]] std::string currentText() const
[[nodiscard]] std::string currentSpeaker() const
[[nodiscard]] std::size_t visibleChars() const
[[nodiscard]] bool isFinished() const
sgc::vn::CharacterManager& characters()
const sgc::vn::CharacterManager& characters() const
[[nodiscard]] bool hasChoices() const
void selectChoice(int index)
[[nodiscard]] const sgc::vn::Backlog& backlog() const
[[nodiscard]] std::vector<sgc::vn::TextSegment> parseEffects(const std::string& text) const
[[nodiscard]] std::string toJson() const

Sourced from docs/API_CATALOG.md, auto-generated by tools/generate_api_catalog.py.