Engine²
Open-source game engine written in C++.
Loading...
Searching...
No Matches
Physics::Utils::ContactCallback< Components > Class Template Reference

#include <ContactCallback.hpp>

Inheritance diagram for Physics::Utils::ContactCallback< Components >:
FunctionUtils::BaseFunction< void, Engine::Core &, Engine::Entity &, Engine::Entity & >

Public Types

using CallbackFunc = std::function<void(Engine::Core &, Engine::Entity &, Engine::Entity &)>

Public Member Functions

 ContactCallback (CallbackFunc cb)
void operator() (Engine::Core &core, Engine::Entity &a, Engine::Entity &b) const final
FunctionUtils::FunctionID GetID () const final
 Pure virtual function to get the unique ID of the function.
Public Member Functions inherited from FunctionUtils::BaseFunction< void, Engine::Core &, Engine::Entity &, Engine::Entity & >
virtual ~BaseFunction ()=default
virtual void operator() (TArgs... args) const=0
 Pure virtual function call operator to be implemented by derived functions.
void Call (TArgs... args) const
 External Call function.
virtual std::string GetName () const=0
 Pure virtual function to get the name of the function.

Private Member Functions

template<typename... Cs>
bool hasAllComponents (Engine::Core &core, const Engine::Entity &entity) const
template<typename C1, typename C2>
void callIfComponentMatch (Engine::Core &core, Engine::Entity &a, Engine::Entity &b) const

Private Attributes

CallbackFunc _callback
 The callback function to call.

Member Typedef Documentation

◆ CallbackFunc

template<typename... Components>
using Physics::Utils::ContactCallback< Components >::CallbackFunc = std::function<void(Engine::Core &, Engine::Entity &, Engine::Entity &)>

Constructor & Destructor Documentation

◆ ContactCallback()

template<typename... Components>
Physics::Utils::ContactCallback< Components >::ContactCallback ( CallbackFunc cb)
inlineexplicit

Member Function Documentation

◆ callIfComponentMatch()

template<typename... Components>
template<typename C1, typename C2>
void Physics::Utils::ContactCallback< Components >::callIfComponentMatch ( Engine::Core & core,
Engine::Entity & a,
Engine::Entity & b ) const
inlineprivate

◆ GetID()

template<typename... Components>
FunctionUtils::FunctionID Physics::Utils::ContactCallback< Components >::GetID ( ) const
inlinefinalvirtual

Pure virtual function to get the unique ID of the function.

Returns
Unique ID of the function.

Implements FunctionUtils::BaseFunction< void, Engine::Core &, Engine::Entity &, Engine::Entity & >.

◆ hasAllComponents()

template<typename... Components>
template<typename... Cs>
bool Physics::Utils::ContactCallback< Components >::hasAllComponents ( Engine::Core & core,
const Engine::Entity & entity ) const
inlineprivate

◆ operator()()

template<typename... Components>
void Physics::Utils::ContactCallback< Components >::operator() ( Engine::Core & core,
Engine::Entity & a,
Engine::Entity & b ) const
inlinefinal

Member Data Documentation

◆ _callback

template<typename... Components>
CallbackFunc Physics::Utils::ContactCallback< Components >::_callback
private

The callback function to call.


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