Nebula
Loading...
Searching...
No Matches
rmluidatabinding.h
Go to the documentation of this file.
1#pragma once
2//------------------------------------------------------------------------------
43//------------------------------------------------------------------------------
44#include "game/entity.h"
45#include "game/component.h"
46#include "util/string.h"
47
48namespace Game
49{
50class World;
51}
52
53namespace RmlUi
54{
55
57struct ComponentBinding;
58
60ComponentBinding* BindComponent(const Util::String& model, const Util::String& name, Game::World* world, Game::Entity entity, Game::ComponentId component);
62template <typename COMPONENT> ComponentBinding* BindComponent(const Util::String& model, const Util::String& name, Game::World* world, Game::Entity entity);
64void SetBindingEntity(ComponentBinding* binding, Game::Entity entity);
66Game::Entity GetBindingEntity(const ComponentBinding* binding);
68void UnbindComponents(const Util::String& model);
69
74
75//------------------------------------------------------------------------------
78template <typename COMPONENT>
79inline ComponentBinding*
80BindComponent(const Util::String& model, const Util::String& name, Game::World* world, Game::Entity entity)
81{
82 return BindComponent(model, name, world, entity, Game::GetComponentId<COMPONENT>());
83}
84
85} // namespace RmlUi
A container of entities, their components, and processors.
Definition world.h:92
Nebula's universal string class.
Definition string.h:50
Game::EditorState.
Definition graphicsmanager.h:66
MemDb::AttributeId ComponentId
Definition componentid.h:15
ComponentId GetComponentId(Util::StringAtom name)
Returns a component id.
Definition component.h:155
Definition rmluifileinterface.cc:11
void SetBindingEntity(ComponentBinding *binding, Game::Entity entity)
point a binding at another entity, e.g. when the player character changes
Definition rmluidatabinding.cc:441
ComponentBinding * BindComponent(const Util::String &model, const Util::String &name, Game::World *world, Game::Entity entity, Game::ComponentId component)
bind a component of an entity as variable 'name' of an existing data model
Definition rmluidatabinding.cc:416
void UnbindComponents(const Util::String &model)
release the bindings of a data model, call before removing the model from the context
Definition rmluidatabinding.cc:462
void UpdateComponentBindings()
mark all bound variables dirty, called every frame by RmlUiContext
Definition rmluidatabinding.cc:478
Game::Entity GetBindingEntity(const ComponentBinding *binding)
get the entity a binding reads from
Definition rmluidatabinding.cc:452
void DiscardComponentBindings()
release all bindings and type definitions, called when RmlUi shuts down
Definition rmluidatabinding.cc:490
An entity is essentially just an Id with some utility functions attached.
Definition entity.h:35
Definition rmluidatabinding.cc:23