Aegis2D
Modular C++26 2D game engine for networked games
Loading...
Searching...
No Matches
components.hpp File Reference

The components of an ECS registry, read and written by Lua scripts. More...

#include <aegis2d/ecs/components.hpp>
#include <aegis2d/ecs/entity.hpp>
#include <aegis2d/ecs/path_following.hpp>
#include <aegis2d/ecs/registry.hpp>
#include <aegis2d/script/export.hpp>
#include <aegis2d/script/state.hpp>
#include <algorithm>
#include <array>
#include <cstddef>
#include <cstdint>
#include <span>
#include <string_view>
#include <vector>

Go to the source code of this file.

Classes

struct  aegis2d::script::detail::Field< Component >
 
struct  aegis2d::script::detail::Kind
 

Namespaces

namespace  aegis2d
 Root namespace of the engine.
 
namespace  aegis2d::script
 Entity behaviors in Lua, so that new enemies and patterns need no recompilation.
 
namespace  aegis2d::script::detail
 Implementation of bind_components(), compiled in the caller's code.
 

Enumerations

enum class  aegis2d::script::detail::FieldType : std::uint8_t { aegis2d::script::detail::Number , aegis2d::script::detail::Integer , aegis2d::script::detail::Unsigned , aegis2d::script::detail::Boolean }
 

Functions

template<typename Component , const auto & Fields>
constexpr Kind aegis2d::script::detail::kind_of (std::string_view name)
 
AEGIS2D_SCRIPT_EXPORT void aegis2d::script::detail::bind_kinds (ScriptState &lua, ecs::Registry &registry, std::span< const Kind > kinds)
 Gives the scripts of a state the components of a registry, through kinds.
 
void aegis2d::script::bind_components (ScriptState &lua, ecs::Registry &registry)
 Gives the scripts of a state the common components of a registry.
 
std::span< const std::string_view > aegis2d::script::component_names () noexcept
 Names of the components scripts can use.
 
std::span< const std::string_view > aegis2d::script::component_fields (std::string_view component) noexcept
 Fields of a component, as scripts name them.
 

Variables

constexpr std::array aegis2d::script::detail::transform_fields
 
constexpr std::array aegis2d::script::detail::velocity_fields
 
constexpr std::array aegis2d::script::detail::sprite_fields
 
constexpr std::array aegis2d::script::detail::animation_fields
 
constexpr std::array aegis2d::script::detail::collider_fields
 
constexpr std::array aegis2d::script::detail::health_fields
 
constexpr std::array aegis2d::script::detail::damage_fields
 
constexpr std::array aegis2d::script::detail::score_fields
 
constexpr std::array aegis2d::script::detail::sine_motion_fields
 
constexpr std::array aegis2d::script::detail::path_follower_fields
 
constexpr std::array aegis2d::script::detail::kinds
 
constexpr std::array aegis2d::script::detail::kind_names
 

Detailed Description

The components of an ECS registry, read and written by Lua scripts.