RTYPE DOCUMENTATION
  • 🍜Welcome
    • R-THAAAAAAï
    • 💽Installation processes
  • 🎮How to play ?
  • 🧱Setup and install process
    • 🪟Windows
    • 🐧Linux
    • 🍎MacOS
  • 💻Development guidelines & how tos
    • ⚙️Configuration
    • 📡Network
      • RFC
    • ⁉️How to ... ?
    • 📕ECS MANUAL
      • Components
      • Sparse Array
      • Systems
      • Registry
      • Worlds
      • Examples
      • A word on singletons
    • 📒Development guidelines
  • 💭Miscellaneous
    • ❤️Credits
    • ⚖️License
Powered by GitBook
On this page
  1. Development guidelines & how tos
  2. ECS MANUAL

Sparse Array

It's a wrapper around a std::vector used to store components of Entities. It got all the utility as a normal vector (end(), begin()...). The special feature of the SparseArray class is that its size never gets smaller. Even if an Entity disapears or is deleted, we only put a std::nullopt at his component location, in this way it could be reused after. Sparse array Class private members :

std::vector<std::optional<Component>> _data

It represents the vector of each component in the current world.

PreviousComponentsNextSystems

Last updated 2 years ago

💻
📕