zengine/game/zworld/editor/zworld_editor.cpp

53 lines
994 B
C++
Raw Normal View History

2024-08-24 18:01:53 +08:00
#define ZLIB_API
#define ZLIB_API_VAL
2024-10-25 09:45:49 +08:00
#define CORE_API
#define CORE_API_VAL
2024-11-09 17:59:48 +08:00
#include "archive/pch.h"
2024-10-25 09:45:49 +08:00
#include "test_refl.h"
using namespace api;
2024-10-25 22:57:25 +08:00
using namespace std;
using namespace refl;
2024-08-24 18:01:53 +08:00
int main() {
2024-11-09 17:59:48 +08:00
//Guid g1(123, 0.456);
//auto text = TextSerialize(g1);
//TextDeserialize<Guid>(text, 0, (float)0.0);
{
using T = Guid;
T a(1,1.0);
a.view = "hello";
auto text = TextSerialize(a);
auto b = TextDeserialize<T>(text);
if (b) {
auto c = b.value();
}
}
{
using T = Guid;
T a(1, 1.0);
a.view = "hello";
auto text = JsonSerialize(a);
auto b = JsonDeserialize<T>(text);
if (b) {
auto c = b.value();
}
}
{
using T = std::basic_string<char>;
T a = "123456";
auto text = TextSerialize(a);
auto b = TextDeserialize<T>(text);
if (b) {
auto c = b.value();
}
}
{
using T = int;
T a = 123456;
auto text = TextSerialize(a);
auto b = TextDeserialize<T>(text);
if (b) {
auto c = b.value();
}
}
2024-08-24 18:01:53 +08:00
std::cout << "hello world" << std::endl;
}