ImagoEngine
A C++ 2D game engine built on a sparse-set ECS, with scenes, scheduled systems, events, and action-based input
Loading...
Searching...
No Matches
Imago::ECS::Bond Class Reference

A Bond permanently reorders every pool within it so that every Entity that has all of the components in the Bond sits at the front of every pool, in the same index at each. Bonds should be used for iterative systems that will execute every frame in every situation (Rendering, Physics, ect.) becuase the time save from no longer checking whether or not each Entity has every component starts to become significant for these systems. More...

#include <Imago/ECS/Bond.hpp>

Public Member Functions

 Bond (const Bond &)=delete
Bond & operator= (const Bond &)=delete
 Bond (Bond &&)=delete
Bond & operator= (Bond &&)=delete
size_t get_bond_size () const
 Returns the number of Entities that are in the bond (have every component).
const std::vector< Entity > & get_entities () const
 Returns the entity array of the first owned pool.
size_t get_pool_count () const
 Returns the number of component pools in the bond.

Friends

class Nexus

Detailed Description

A Bond permanently reorders every pool within it so that every Entity that has all of the components in the Bond sits at the front of every pool, in the same index at each. Bonds should be used for iterative systems that will execute every frame in every situation (Rendering, Physics, ect.) becuase the time save from no longer checking whether or not each Entity has every component starts to become significant for these systems.

However, each Component Type can only be bonded once as whichever Bond it is a part of now has full ownership of that Component pool, so it is important to choose wisely what Bonds you are creating.

The Bond is owned and notified by the Nexus so that it can be resorted whenever component data changes.


The documentation for this class was generated from the following files:
  • engine/include/Imago/ECS/Bond.hpp
  • engine/src/ECS/Bond.cpp