Aegis2D
Modular C++26 2D game engine for networked games
Loading...
Searching...
No Matches
aegis2d::ecs::CollisionPair Struct Reference

Two entities that may collide, the one with the smaller handle first. More...

#include <aegis2d/ecs/collision.hpp>

Static Public Member Functions

static constexpr CollisionPair of (Entity a, Entity b) noexcept
 Builds a pair in canonical order, whatever the order of the arguments.
 

Public Attributes

Entity first
 Entity with the smaller handle.
 
Entity second
 Entity with the larger handle.
 

Friends

constexpr bool operator== (const CollisionPair &, const CollisionPair &) noexcept=default
 Compares the pairs.
 
constexpr std::strong_ordering operator<=> (const CollisionPair &, const CollisionPair &) noexcept=default
 Orders the pairs by first, then second entity.
 

Detailed Description

Two entities that may collide, the one with the smaller handle first.

Member Function Documentation

◆ of()

static constexpr CollisionPair aegis2d::ecs::CollisionPair::of ( Entity  a,
Entity  b 
)
inlinestaticconstexprnoexcept

Builds a pair in canonical order, whatever the order of the arguments.

Parameters
aOne entity.
bThe other entity.
Returns
{min(a, b), max(a, b)}.

Friends And Related Symbol Documentation

◆ operator<=>

constexpr std::strong_ordering operator<=> ( const CollisionPair &  ,
const CollisionPair &   
)
friend

Orders the pairs by first, then second entity.

◆ operator==

constexpr bool operator== ( const CollisionPair &  ,
const CollisionPair &   
)
friend

Compares the pairs.

Member Data Documentation

◆ first

Entity aegis2d::ecs::CollisionPair::first

Entity with the smaller handle.

◆ second

Entity aegis2d::ecs::CollisionPair::second

Entity with the larger handle.


The documentation for this struct was generated from the following file: