zengine/game/zworld/editor/zworld_editor.cpp

26 lines
690 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
#include "archive/json.h"
#include "test_refl.h"
#include <os/file_handle.h>
using namespace api;
2024-08-24 18:01:53 +08:00
int main() {
2024-10-25 09:45:49 +08:00
table<uint32_t, string> t1, t2;
t1[1] = "hello";
t1[2] = "world";
auto text = JsonSerialize(t1);
FileHandle handle("test.txt");
handle.Open(FILE_OP::WRITE, false);
handle.Write(text);
auto res = JsonDeserialize<table<uint32_t, string>>(text);
if (res) {
t2 = *res;
}
auto cls = meta_info<api::Guid>();
Any args[3] = { Any{ (int)2 }, Any{ (float)3 }, Any{false} };
Any obj = cls->New(FramePool(), span<Any>{args});
auto ptr = &api::Guid::Multy;
2024-08-24 18:01:53 +08:00
std::cout << "hello world" << std::endl;
}