RTYPE TECHNICAL DOCUMENTATION
  • Introduction
  • Classes
    • utils::InputMap
    • utils::Window
    • utils::constant::ButtonValue
    • network::Client
    • network::LockedQueue
    • network::Server
    • ecs::EnemyFactory
    • ecs::Engine
    • ecs::Entity
    • ecs::Event
    • ecs::Registry
    • ecs::SparseArray
    • ecs::World
    • ecs::WorldManager
    • ecs::component::Activable
    • ecs::component::Animated
    • ecs::component::Animated::AnimFrame
    • ecs::component::AttackAI
    • ecs::component::AttackAI::Action
    • ecs::component::AttackAI::AI
    • ecs::component::AttackAI::AI::Pattern
    • ecs::component::Controllable
    • ecs::component::Direction
    • ecs::component::Drawable
    • ecs::component::EntityType
    • ecs::component::Faction
    • ecs::component::FollowEntity
    • ecs::component::Health
    • ecs::component::Hitbox
    • ecs::component::MovementAI
    • ecs::component::MovementAI::AI
    • ecs::component::NetworkId
    • ecs::component::Parallax
    • ecs::component::Position
    • ecs::component::Projectile
    • ecs::component::Score
    • ecs::component::Shootable
    • ecs::component::Size
    • ecs::component::Text
    • ecs::component::textColor
    • ecs::component::Velocity
    • ecs::component::Weapon
    • audio::AudioManager
    • asset::AssetLoader
    • anim::Animation
  • Namespaces
    • utils
    • utils::constant
    • network
    • ecs
    • ecs::component
    • ecs::systems
    • audio
    • asset
    • anim
  • Modules
    • Input
  • Files
    • src
    • src/client
    • Animation.cpp
    • Animation.hpp
    • AssetLoader.cpp
    • AssetLoader.hpp
    • AudioManager.cpp
    • AudioManager.hpp
    • entrypoint.cpp
    • GetWorld.cpp
    • GetWorld.hpp
    • NetworkClient.cpp
    • NetworkClient.hpp
    • src/ecs
    • src/ecs/components
    • src/ecs/components/client
    • Activable.hpp
    • Animated.hpp
    • Controllable.hpp
    • Drawable.hpp
    • Hitbox.hpp
    • Parallax.hpp
    • Shootable.hpp
    • Text.hpp
    • src/ecs/components/server
    • AttackAI.cpp
    • AttackAI.hpp
    • FollowEntity.hpp
    • Projectile.hpp
    • Direction.hpp
    • EntityType.hpp
    • Faction.hpp
    • Health.hpp
    • MovementAI.cpp
    • MovementAI.hpp
    • NetworkId.hpp
    • Position.hpp
    • Score.hpp
    • Size.hpp
    • Velocity.hpp
    • Weapon.hpp
    • src/ecs/systems
    • src/ecs/systems/client
    • Animate.hpp
    • Draw.hpp
    • ExecuteOnce.hpp
    • HandleIncomingMessages.hpp
    • HandleParallaxBounds.hpp
    • HandleSFMLEvents.hpp
    • HandleSFMLKeys.hpp
    • HealthBar.hpp
    • MenuSelect.hpp
    • ScoreUpdate.hpp
    • SendDirection.hpp
    • src/ecs/systems/server
    • DeathUpdate.hpp
    • FollowEntitySystem.hpp
    • HandleIncomingMessage.hpp
    • PlayerHealthUpdate.hpp
    • PositionUpdate.hpp
    • ProjectileCollision.hpp
    • RunAttackAI.hpp
    • Waves.hpp
    • ManageClientEvents.hpp
    • Movement.hpp
    • PositionLogger.hpp
    • RunMovementAI.hpp
    • EnemyFactory.cpp
    • EnemyFactory.hpp
    • Engine.hpp
    • Entity.hpp
    • Event.hpp
    • LockedQueue.hpp
    • Registry.hpp
    • SparseArray.hpp
    • World.hpp
    • WorldManager.cpp
    • WorldManager.hpp
    • src/server
    • entrypoint.cpp
    • Server.cpp
    • Server.hpp
    • src/utils
    • Constant.hpp
    • InputMap.cpp
    • InputMap.hpp
    • Window.cpp
    • README.md
  • Pages
    • deprecated
  • GitHub
Powered by GitBook
On this page
  • Public Types
  • Public Functions
  • Detailed Description
  • Public Types Documentation
  • using valueType
  • using referenceType
  • using constReferenceType
  • using container
  • using sizeType
  • using iterator
  • using constIterator
  • Public Functions Documentation
  • function SparseArray
  • function SparseArray
  • function SparseArray
  • function ~SparseArray
  • function operator=
  • function operator=
  • function operator[]
  • function operator[]
  • function begin
  • function begin
  • function cBegin
  • function end
  • function end
  • function cEnd
  • function size
  • function insertAt
  • function insertAt
  • function emplaceAt
  • function erase
  • function getIndex
  1. Classes

ecs::SparseArray

Previousecs::RegistryNextecs::World

Last updated 2 years ago

#include <SparseArray.hpp>

Public Types

Name

using std::optional< Component >

using typename container::size_type

using typename container::iterator

using typename container::const_iterator

Public Functions

Name

void

Detailed Description

template <typename Component >
class ecs::SparseArray;

Template Parameters:

  • Component The type of component used as with template

This can be quite useful to store components that are defined for most entities, because you don't have to store the entity ID alongside the component.

Public Types Documentation

using valueType

using ecs::SparseArray< Component >::valueType =  std::optional<Component>;

using referenceType

using ecs::SparseArray< Component >::referenceType =  valueType &;

using constReferenceType

using ecs::SparseArray< Component >::constReferenceType =  valueType const &;

using container

using ecs::SparseArray< Component >::container =  std::vector<valueType>;

using sizeType

using ecs::SparseArray< Component >::sizeType =  typename container::size_type;

using iterator

using ecs::SparseArray< Component >::iterator =  typename container::iterator;

using constIterator

using ecs::SparseArray< Component >::constIterator =  typename container::const_iterator;

Public Functions Documentation

function SparseArray

inline SparseArray()

function SparseArray

inline SparseArray(
    SparseArray const & other
)

function SparseArray

inline SparseArray(
    SparseArray && other
)

function ~SparseArray

~SparseArray() =default

function operator=

inline SparseArray & operator=(
    SparseArray const & other
)

Parameters:

Return: The Sparse array present in the class at the moment

function operator=

inline SparseArray & operator=(
    SparseArray && other
)

Parameters:

Return: The Sparse array present in the class at the moment

function operator[]

inline referenceType operator[](
    size_t idx
)

function operator[]

inline constReferenceType operator[](
    size_t idx
) const

function begin

inline iterator begin()

function begin

inline constIterator begin() const

function cBegin

inline constIterator cBegin() const

function end

inline iterator end()

function end

inline constIterator end() const

function cEnd

inline constIterator cEnd() const

function size

inline sizeType size() const

function insertAt

inline referenceType insertAt(
    sizeType pos,
    Component const & c
)

function insertAt

inline referenceType insertAt(
    sizeType pos,
    Component && c
)

function emplaceAt

template <class... Params>
inline referenceType emplaceAt(
    sizeType pos,
    Params &&... args
)

function erase

inline void erase(
    sizeType pos
)

function getIndex

inline sizeType getIndex(
    valueType const & c
) const

Parameters:

  • c The std::optional, type of the component you want the index

Return: The sizeType of the valueType's index you are looking for

This function is used to get the index of the std::optional of the std::vector<std::optional> _data according to the given valueType (std::optional)


Updated on 2022-11-13 at 17:21:37 +0100

using &

using const &

using std::vector< >

()

( const & other)

( && other)

() =default

&

( const & other)

&

( && other)

(size_t idx)

(size_t idx) const

()

() const

() const

()

() const

() const

() const

( pos, Component const & c)

( pos, Component && c)

template <class... Params>

( pos, Params &&... args)

( pos)

( const & c) const

class is the component container of the ecs.

Default constructor & destructor of the class

other The you want to copy

Operator copy of the class

other The you want to move

Operator move of the class

SparseArray
SparseArray
SparseArray
SparseArray
SparseArray
SparseArray
More...
valueType
valueType
referenceType
valueType
constReferenceType
valueType
container
sizeType
iterator
constIterator
SparseArray
SparseArray
SparseArray
SparseArray
SparseArray
~SparseArray
SparseArray
operator=
SparseArray
SparseArray
operator=
SparseArray
referenceType
operator[]
constReferenceType
operator[]
iterator
begin
constIterator
begin
constIterator
cBegin
iterator
end
constIterator
end
constIterator
cEnd
sizeType
size
referenceType
insertAt
sizeType
referenceType
insertAt
sizeType
referenceType
emplaceAt
sizeType
erase
sizeType
sizeType
getIndex
valueType