[nostalgia/scene] Add models for Doc types
This commit is contained in:
parent
9db256699d
commit
17ead36d2f
@ -8,6 +8,7 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <ox/std/error.hpp>
|
||||
#include <ox/std/types.hpp>
|
||||
#include <ox/std/vector.hpp>
|
||||
|
||||
@ -25,6 +26,14 @@ struct TileDoc {
|
||||
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
constexpr ox::Error model(T *io, TileDoc *obj) {
|
||||
io->template setTypeInfo<TileDoc>();
|
||||
oxReturnError(io->field("sheetIdx", &obj->sheetIdx));
|
||||
oxReturnError(io->field("type", &obj->type));
|
||||
return OxError(0);
|
||||
}
|
||||
|
||||
struct SceneDoc {
|
||||
|
||||
using TileMapRow = ox::Vector<TileDoc>;
|
||||
@ -40,6 +49,13 @@ struct SceneDoc {
|
||||
|
||||
};
|
||||
|
||||
template<typename T>
|
||||
constexpr ox::Error model(T *io, SceneDoc *obj) {
|
||||
io->template setTypeInfo<SceneDoc>();
|
||||
oxReturnError(io->field("tiles", &obj->tiles));
|
||||
return OxError(0);
|
||||
}
|
||||
|
||||
struct SceneInstance {
|
||||
|
||||
uint16_t layers = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user