update subtree entt Merge commit '90ce4bda4e1dc23508bbd6b6923156cd5a370c18'
This commit is contained in:
10
external/entt/entt/test/lib/dispatcher/common/types.h
vendored
Normal file
10
external/entt/entt/test/lib/dispatcher/common/types.h
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
#ifndef ENTT_LIB_DISPATCHER_COMMON_TYPES_H
|
||||
#define ENTT_LIB_DISPATCHER_COMMON_TYPES_H
|
||||
|
||||
struct message {
|
||||
int payload;
|
||||
};
|
||||
|
||||
struct event {};
|
||||
|
||||
#endif
|
||||
@@ -4,7 +4,7 @@
|
||||
#include <cr.h>
|
||||
#include <entt/signal/dispatcher.hpp>
|
||||
#include <entt/signal/sigh.hpp>
|
||||
#include "types.h"
|
||||
#include "../common/types.h"
|
||||
|
||||
struct listener {
|
||||
void on(message msg) {
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <cr.h>
|
||||
#include <entt/signal/dispatcher.hpp>
|
||||
#include "types.h"
|
||||
#include "../common/types.h"
|
||||
|
||||
CR_EXPORT int cr_main(cr_plugin *ctx, cr_op operation) {
|
||||
switch(operation) {
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <entt/core/attribute.h>
|
||||
#include <entt/signal/dispatcher.hpp>
|
||||
#include "types.h"
|
||||
#include "../common/types.h"
|
||||
|
||||
ENTT_API void trigger(entt::dispatcher &dispatcher) {
|
||||
dispatcher.trigger<event>();
|
||||
@@ -3,7 +3,7 @@
|
||||
#include <entt/core/utility.hpp>
|
||||
#include <entt/signal/dispatcher.hpp>
|
||||
#include <entt/signal/sigh.hpp>
|
||||
#include "types.h"
|
||||
#include "../common/types.h"
|
||||
|
||||
ENTT_API void trigger(entt::dispatcher &);
|
||||
|
||||
12
external/entt/entt/test/lib/dispatcher/types.h
vendored
12
external/entt/entt/test/lib/dispatcher/types.h
vendored
@@ -1,12 +0,0 @@
|
||||
#ifndef ENTT_LIB_DISPATCHER_TYPES_H
|
||||
#define ENTT_LIB_DISPATCHER_TYPES_H
|
||||
|
||||
#include <entt/core/attribute.h>
|
||||
|
||||
struct ENTT_API message {
|
||||
int payload;
|
||||
};
|
||||
|
||||
struct ENTT_API event {};
|
||||
|
||||
#endif
|
||||
@@ -1,10 +0,0 @@
|
||||
#ifndef ENTT_LIB_DISPATCHER_PLUGIN_TYPES_H
|
||||
#define ENTT_LIB_DISPATCHER_PLUGIN_TYPES_H
|
||||
|
||||
struct message {
|
||||
int payload;
|
||||
};
|
||||
|
||||
struct event {};
|
||||
|
||||
#endif
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef ENTT_LIB_EMITTER_PLUGIN_TYPES_H
|
||||
#define ENTT_LIB_EMITTER_PLUGIN_TYPES_H
|
||||
#ifndef ENTT_LIB_EMITTER_COMMON_TYPES_H
|
||||
#define ENTT_LIB_EMITTER_COMMON_TYPES_H
|
||||
|
||||
#include <entt/signal/emitter.hpp>
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
|
||||
#include <gtest/gtest.h>
|
||||
#include <cr.h>
|
||||
#include "types.h"
|
||||
#include "../common/types.h"
|
||||
|
||||
TEST(Lib, Emitter) {
|
||||
test_emitter emitter;
|
||||
@@ -1,5 +1,5 @@
|
||||
#include <cr.h>
|
||||
#include "types.h"
|
||||
#include "../common/types.h"
|
||||
|
||||
CR_EXPORT int cr_main(cr_plugin *ctx, cr_op operation) {
|
||||
switch(operation) {
|
||||
@@ -1,5 +1,5 @@
|
||||
#include <entt/core/attribute.h>
|
||||
#include "types.h"
|
||||
#include "../common/types.h"
|
||||
|
||||
ENTT_API void emit(test_emitter &emitter) {
|
||||
emitter.publish(event{});
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <gtest/gtest.h>
|
||||
#include <entt/core/attribute.h>
|
||||
#include "types.h"
|
||||
#include "../common/types.h"
|
||||
|
||||
ENTT_API void emit(test_emitter &);
|
||||
|
||||
16
external/entt/entt/test/lib/emitter/types.h
vendored
16
external/entt/entt/test/lib/emitter/types.h
vendored
@@ -1,16 +0,0 @@
|
||||
#ifndef ENTT_LIB_EMITTER_TYPES_H
|
||||
#define ENTT_LIB_EMITTER_TYPES_H
|
||||
|
||||
#include <entt/core/attribute.h>
|
||||
#include <entt/signal/emitter.hpp>
|
||||
|
||||
struct ENTT_API test_emitter
|
||||
: entt::emitter<test_emitter> {};
|
||||
|
||||
struct ENTT_API message {
|
||||
int payload;
|
||||
};
|
||||
|
||||
struct ENTT_API event {};
|
||||
|
||||
#endif
|
||||
8
external/entt/entt/test/lib/locator/common/types.h
vendored
Normal file
8
external/entt/entt/test/lib/locator/common/types.h
vendored
Normal file
@@ -0,0 +1,8 @@
|
||||
#ifndef ENTT_LIB_LOCATOR_COMMON_TYPES_H
|
||||
#define ENTT_LIB_LOCATOR_COMMON_TYPES_H
|
||||
|
||||
struct service {
|
||||
int value;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -3,6 +3,7 @@
|
||||
#include <gtest/gtest.h>
|
||||
#include <cr.h>
|
||||
#include <entt/locator/locator.hpp>
|
||||
#include "../common/types.h"
|
||||
#include "types.h"
|
||||
|
||||
TEST(Lib, Locator) {
|
||||
@@ -10,9 +11,7 @@ TEST(Lib, Locator) {
|
||||
|
||||
ASSERT_EQ(entt::locator<service>::value().value, 42);
|
||||
|
||||
userdata ud{};
|
||||
ud.handle = entt::locator<service>::handle();
|
||||
ud.value = 3;
|
||||
userdata ud{entt::locator<service>::handle(), 3};
|
||||
|
||||
cr_plugin ctx;
|
||||
ctx.userdata = &ud;
|
||||
@@ -1,5 +1,6 @@
|
||||
#include <cr.h>
|
||||
#include <entt/locator/locator.hpp>
|
||||
#include "../common/types.h"
|
||||
#include "types.h"
|
||||
|
||||
CR_EXPORT int cr_main(cr_plugin *ctx, cr_op operation) {
|
||||
@@ -3,13 +3,10 @@
|
||||
|
||||
#include <entt/locator/locator.hpp>
|
||||
|
||||
struct service {
|
||||
int value;
|
||||
};
|
||||
struct service;
|
||||
|
||||
struct userdata {
|
||||
using node_type = typename entt::locator<service>::node_type;
|
||||
node_type handle;
|
||||
typename entt::locator<service>::node_type handle;
|
||||
int value;
|
||||
};
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <entt/core/attribute.h>
|
||||
#include <entt/locator/locator.hpp>
|
||||
#include "types.h"
|
||||
#include "../common/types.h"
|
||||
|
||||
ENTT_API void set_up(const entt::locator<service>::node_type &handle) {
|
||||
entt::locator<service>::reset(handle);
|
||||
@@ -1,7 +1,7 @@
|
||||
#include <gtest/gtest.h>
|
||||
#include <entt/core/attribute.h>
|
||||
#include <entt/locator/locator.hpp>
|
||||
#include "types.h"
|
||||
#include "../common/types.h"
|
||||
|
||||
ENTT_API void set_up(const entt::locator<service>::node_type &);
|
||||
ENTT_API void use_service(int);
|
||||
8
external/entt/entt/test/lib/locator/types.h
vendored
8
external/entt/entt/test/lib/locator/types.h
vendored
@@ -1,8 +0,0 @@
|
||||
#ifndef ENTT_LIB_LOCATOR_TYPES_H
|
||||
#define ENTT_LIB_LOCATOR_TYPES_H
|
||||
|
||||
struct service {
|
||||
int value;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef ENTT_LIB_META_TYPES_H
|
||||
#define ENTT_LIB_META_TYPES_H
|
||||
#ifndef ENTT_LIB_META_COMMON_TYPES_H
|
||||
#define ENTT_LIB_META_COMMON_TYPES_H
|
||||
|
||||
struct position {
|
||||
int x;
|
||||
@@ -14,8 +14,7 @@ TEST(Lib, Meta) {
|
||||
|
||||
ASSERT_FALSE(entt::resolve("position"_hs));
|
||||
|
||||
userdata ud{};
|
||||
ud.ctx = entt::locator<entt::meta_ctx>::handle();
|
||||
userdata ud{entt::locator<entt::meta_ctx>::handle(), entt::meta_any{}};
|
||||
|
||||
cr_plugin ctx;
|
||||
ctx.userdata = &ud;
|
||||
@@ -4,6 +4,7 @@
|
||||
#include <entt/meta/context.hpp>
|
||||
#include <entt/meta/factory.hpp>
|
||||
#include <entt/meta/meta.hpp>
|
||||
#include "../common/types.h"
|
||||
#include "types.h"
|
||||
|
||||
position create_position(int x, int y) {
|
||||
@@ -4,16 +4,6 @@
|
||||
#include <entt/locator/locator.hpp>
|
||||
#include <entt/meta/meta.hpp>
|
||||
|
||||
struct position {
|
||||
int x;
|
||||
int y;
|
||||
};
|
||||
|
||||
struct velocity {
|
||||
double dx;
|
||||
double dy;
|
||||
};
|
||||
|
||||
struct userdata {
|
||||
entt::locator<entt::meta_ctx>::node_type ctx;
|
||||
entt::meta_any any;
|
||||
@@ -3,6 +3,7 @@
|
||||
#include <entt/meta/context.hpp>
|
||||
#include <entt/meta/factory.hpp>
|
||||
#include <entt/meta/meta.hpp>
|
||||
#include "../common/types.h"
|
||||
#include "types.h"
|
||||
|
||||
position create_position(int x, int y) {
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef ENTT_LIB_META_PLUGIN_TYPES_STD_H
|
||||
#define ENTT_LIB_META_PLUGIN_TYPES_STD_H
|
||||
#ifndef ENTT_LIB_META_PLUGIN_STD_TYPES_H
|
||||
#define ENTT_LIB_META_PLUGIN_STD_TYPES_H
|
||||
|
||||
#include <type_traits>
|
||||
#include <entt/core/hashed_string.hpp>
|
||||
@@ -17,15 +17,8 @@ struct custom_type_hash;
|
||||
} \
|
||||
}
|
||||
|
||||
struct position {
|
||||
int x;
|
||||
int y;
|
||||
};
|
||||
|
||||
struct velocity {
|
||||
double dx;
|
||||
double dy;
|
||||
};
|
||||
struct position;
|
||||
struct velocity;
|
||||
|
||||
struct userdata {
|
||||
entt::locator<entt::meta_ctx>::node_type ctx;
|
||||
@@ -2,7 +2,7 @@
|
||||
#include <entt/core/hashed_string.hpp>
|
||||
#include <entt/meta/factory.hpp>
|
||||
#include <entt/meta/meta.hpp>
|
||||
#include "types.h"
|
||||
#include "../common/types.h"
|
||||
|
||||
position create_position(int x, int y) {
|
||||
return position{x, y};
|
||||
@@ -4,7 +4,7 @@
|
||||
#include <entt/meta/factory.hpp>
|
||||
#include <entt/meta/meta.hpp>
|
||||
#include <entt/meta/resolve.hpp>
|
||||
#include "types.h"
|
||||
#include "../common/types.h"
|
||||
|
||||
ENTT_API void share(entt::locator<entt::meta_ctx>::node_type);
|
||||
ENTT_API void set_up();
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef ENTT_LIB_REGISTRY_PLUGIN_TYPES_H
|
||||
#define ENTT_LIB_REGISTRY_PLUGIN_TYPES_H
|
||||
#ifndef ENTT_LIB_REGISTRY_COMMON_TYPES_H
|
||||
#define ENTT_LIB_REGISTRY_COMMON_TYPES_H
|
||||
|
||||
struct position {
|
||||
int x;
|
||||
@@ -3,7 +3,7 @@
|
||||
#include <gtest/gtest.h>
|
||||
#include <cr.h>
|
||||
#include <entt/entity/registry.hpp>
|
||||
#include "types.h"
|
||||
#include "../common/types.h"
|
||||
|
||||
TEST(Lib, Registry) {
|
||||
entt::registry registry;
|
||||
@@ -1,6 +1,6 @@
|
||||
#include <cr.h>
|
||||
#include <entt/entity/registry.hpp>
|
||||
#include "types.h"
|
||||
#include "../common/types.h"
|
||||
|
||||
CR_EXPORT int cr_main(cr_plugin *ctx, cr_op operation) {
|
||||
switch(operation) {
|
||||
@@ -1,6 +1,8 @@
|
||||
#include <entt/core/attribute.h>
|
||||
#include <entt/entity/registry.hpp>
|
||||
#include "types.h"
|
||||
#include "../common/types.h"
|
||||
|
||||
template class entt::basic_registry<entt::entity>;
|
||||
|
||||
ENTT_API void update_position(entt::registry ®istry) {
|
||||
registry.view<position, velocity>().each([](auto &pos, auto &vel) {
|
||||
@@ -2,7 +2,7 @@
|
||||
#include <entt/core/attribute.h>
|
||||
#include <entt/entity/entity.hpp>
|
||||
#include <entt/entity/registry.hpp>
|
||||
#include "types.h"
|
||||
#include "../common/types.h"
|
||||
|
||||
ENTT_API void update_position(entt::registry &);
|
||||
ENTT_API void emplace_velocity(entt::registry &);
|
||||
16
external/entt/entt/test/lib/registry/types.h
vendored
16
external/entt/entt/test/lib/registry/types.h
vendored
@@ -1,16 +0,0 @@
|
||||
#ifndef ENTT_LIB_REGISTRY_TYPES_H
|
||||
#define ENTT_LIB_REGISTRY_TYPES_H
|
||||
|
||||
#include <entt/core/attribute.h>
|
||||
|
||||
struct ENTT_API position {
|
||||
int x;
|
||||
int y;
|
||||
};
|
||||
|
||||
struct ENTT_API velocity {
|
||||
double dx;
|
||||
double dy;
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user