27 [[nodiscard]]
inline entt::basic_registry<EntityId>& getRegistry() noexcept {
return mEnTTRegistry; }
29 [[nodiscard]]
inline entt::basic_registry<EntityId>
const& getRegistry() const noexcept {
return mEnTTRegistry; }
33 return getRegistry().try_get<T>(mEntity);
38 return const_cast<T*
>(std::as_const(getRegistry()).try_get<T>(mEntity));
42 [[nodiscard]]
inline bool hasComponent()
const {
43 return getRegistry().all_of<T>(mEntity);
47 inline bool removeComponent() {
48 return getRegistry().remove<T>(mEntity);
51 template <
class T,
typename... Args>
52 [[nodiscard]]
inline T& getOrAddComponent(Args&&... args) {
53 return getRegistry().get_or_emplace<T>(mEntity, std::forward<Args>(args)...);
60 ::entt::basic_registry<::EntityId>& mEnTTRegistry;
67 MCAPI ::WeakRef<::EntityContext> getWeakRef()
const;
69 MCAPI
bool isValid()
const;
Definition EntityContext.h:16
Definition EntityContext.h:24