Euphoria
|
ecs.cc
Go to the documentation of this file.
81 [[nodiscard]] std::vector<EntityHandle> view(const std::vector<ComponentIndex>& matching_components) const
86 for(int signature_index=0; signature_index<c_sizet_to_int(signatures.size()); signature_index += 1)
96 [[nodiscard]] bool has_components(EntityHandle handle, const std::vector<ComponentIndex>& components) const
155 void set_component_array(ComponentIndex comp_ind, std::unique_ptr<ComponentArrayBase>&& components)
206 ComponentIndex set_component_array(const std::string& name, std::unique_ptr<ComponentArrayBase>&& components)
263 ComponentIndex Registry::set_component_array(const std::string& name, std::unique_ptr<ComponentArrayBase>&& components)
279 std::vector<EntityHandle> Registry::view(const std::vector<ComponentIndex>& matching_components) const
Definition: ecs.cc:11
Definition: ecs.cc:49
void set_component(EntityHandle handle, ComponentIndex component, bool has)
Definition: ecs.cc:75
std::vector< EntityHandle > view(const std::vector< ComponentIndex > &matching_components) const
Definition: ecs.cc:81
std::vector< EntityHandle > free_handles
Definition: ecs.cc:51
bool has_components(EntityHandle handle, const std::vector< ComponentIndex > &components) const
Definition: ecs.cc:96
Definition: ecs.cc:152
ComponentArrayBase * get_components_base(ComponentIndex comp_ind)
Definition: ecs.cc:172
std::vector< std::unique_ptr< ComponentArrayBase > > component_arrays
Definition: ecs.cc:153
void set_component_array(ComponentIndex comp_ind, std::unique_ptr< ComponentArrayBase > &&components)
Definition: ecs.cc:155
const ComponentArrayBase * get_components_base(ComponentIndex comp_ind) const
Definition: ecs.cc:180
void destroy_entity(EntityHandle entity)
Definition: ecs.cc:164
Definition: ecs.h:27
ComponentArrayBase(std::string_view n)
Definition: ecs.cc:18
Definition: ecs.cc:123
std::string get_name(ComponentIndex c)
Definition: ecs.cc:144
ComponentIndex get_index(const std::string &name)
Definition: ecs.cc:137
std::vector< std::string > index_to_name
Definition: ecs.cc:125
std::unordered_map< std::string, ComponentIndex > name_to_index
Definition: ecs.cc:124
ComponentIndex add(const std::string &name)
Definition: ecs.cc:127
Definition: ecs.cc:190
ComponentIndex set_component_array(const std::string &name, std::unique_ptr< ComponentArrayBase > &&components)
Definition: ecs.cc:206
std::vector< EntityHandle > view(const std::vector< ComponentIndex > &matching_components) const
Definition: ecs.cc:218
KnownComponentTypes known_component_types
Definition: ecs.cc:192
ComponentArrayBase * get_components_base(ComponentIndex comp_ind)
Definition: ecs.cc:213
bool has_component(EntityHandle entity, ComponentIndex comp_ind) const
Definition: ecs.cc:258
ComponentIndex set_component_array(const std::string &name, std::unique_ptr< ComponentArrayBase > &&components)
Definition: ecs.cc:263
int get_number_of_active_entities() const
Definition: ecs.cc:236
std::vector< EntityHandle > view(const std::vector< ComponentIndex > &matching_components) const
Definition: ecs.cc:279
std::string get_component_debug_name(ComponentIndex c) const
Definition: ecs.cc:247
Definition: ecs.cc:26
void set_component(ComponentIndex c, bool has)
Definition: ecs.cc:29
bool has_component(ComponentIndex c) const
Definition: ecs.cc:40