xentara-plugin v2.0.3
The Xentara Plugin Framework
Loading...
Searching...
No Matches
xentara::skill::Skill::ConcreteClass< DerivedSkill, kName, kUuid, ElementClasses > Class Template Reference

Convenience subclass of Class that implements all callbacks. More...

#include <xentara/skill/Skill.hpp>

+ Inheritance diagram for xentara::skill::Skill::ConcreteClass< DerivedSkill, kName, kUuid, ElementClasses >:

Private Member Functions

Virtual Overrides for Class


auto name () const -> std::string_view final
 Virtual override for Class::name()
 
auto uuid () const -> utils::core::Uuid final
 Virtual override for Class::uuid()
 
auto registerElements (Registry &registry) -> void final
 Virtual override for Class::registerElements()
 

Additional Inherited Members

- Public Member Functions inherited from xentara::skill::Skill::Class
virtual ~Class ()=0
 Virtual destructor.
 
- Public Member Functions inherited from xentara::utils::tools::DisableCopy
constexpr DisableCopy () noexcept=default
 
 DisableCopy (const DisableCopy &)=delete
 
DisableCopyoperator= (const DisableCopy &)=delete
 

Detailed Description

template<typename DerivedSkill, utils::tparam::String kName, utils::tparam::Uuid kUuid, std::derived_from< Element::Class >... ElementClasses>
class xentara::skill::Skill::ConcreteClass< DerivedSkill, kName, kUuid, ElementClasses >

Convenience subclass of Class that implements all callbacks.

This class is a convenience class that implements all the virtual member functions of Class using the given template parameters. Instead of implementing your own subclass of Class, you can use a specialization of this template:

class MySkill final : public skill::Skill
{
private:
using Class = ConcreteClass<MySkill,
"MySkill",
"ea39e37e-cf11-4c85-8435-d4df5f588b10"_uuid,
MyElement1::Class,
MyElement2::Class>;
static Class _class;
};
Meta-Information about a skill class.
Definition Skill.hpp:131
Convenience subclass of Class that implements all callbacks.
Definition Skill.hpp:189
A Xentara skill.
Definition Skill.hpp:36
Template Parameters
DerivedSkillThe skill class this object represents. This class must be derived from Skill. An object of this class will be created and returned by the createSkill() callback.
kNameA string literal containing the name of the skill, in UTF-8 encoding. This name will be returned by the name() callback.
kUuidA UUID literal containing the UUID of the skill. This UUID will be returned by the uuid() callback.
ElementClasses...All the element classes the skill provides. The classes must provide a static member function named instance() that returns a non-const reference to a global instance of the class, as demonstated by Element::ConcreteClass::instance(). The skill class will register all the instances returned by ElementClasses::instance()... in the registerElements() callback().

Member Function Documentation

◆ name()

template<typename DerivedSkill , utils::tparam::String kName, utils::tparam::Uuid kUuid, std::derived_from< Element::Class >... ElementClasses>
auto xentara::skill::Skill::ConcreteClass< DerivedSkill, kName, kUuid, ElementClasses >::name ( ) const -> std::string_view
finalprivatevirtual

Virtual override for Class::name()

This function returns the kName template parameter.

Implements xentara::skill::Skill::Class.

◆ registerElements()

template<typename DerivedSkill , utils::tparam::String kName, utils::tparam::Uuid kUuid, std::derived_from< Element::Class >... ElementClasses>
auto xentara::skill::Skill::ConcreteClass< DerivedSkill, kName, kUuid, ElementClasses >::registerElements ( Registry registry) -> void
finalprivatevirtual

Virtual override for Class::registerElements()

This function registers one class from each of the ElementClasses template parameters.

Implements xentara::skill::Skill::Class.

◆ uuid()

template<typename DerivedSkill , utils::tparam::String kName, utils::tparam::Uuid kUuid, std::derived_from< Element::Class >... ElementClasses>
auto xentara::skill::Skill::ConcreteClass< DerivedSkill, kName, kUuid, ElementClasses >::uuid ( ) const -> utils::core::Uuid
finalprivatevirtual

Virtual override for Class::uuid()

This function returns the kUuid template parameter.

Implements xentara::skill::Skill::Class.