summaryrefslogtreecommitdiffhomepage
path: root/loader/json.cpp
blob: 1a698a38308d6556af61c665b88f1ea85167bce5 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include "impl.hpp"
#include "serialize/json-helper.hpp"
#include "serialize/anim.hpp"
#include "serialize/tile-atlas.hpp"
#include "serialize/scenery.hpp"
#include <Corrade/Utility/Path.h>

namespace floormat::loader_detail {

anim_def loader_impl::deserialize_anim(StringView filename)
{
    return json_helper::from_json<anim_def>(filename);
}

} // namespace floormat::loader_detail

namespace floormat {

std::vector<std::shared_ptr<struct tile_atlas>> loader_::tile_atlases(StringView filename)
{
    return json_helper::from_json<std::vector<std::shared_ptr<struct tile_atlas>>>(Path::join(loader_::IMAGE_PATH, filename));
}

std::vector<Serialize::serialized_scenery> loader_::sceneries()
{
    return json_helper::from_json<std::vector<Serialize::serialized_scenery>>(Path::join(SCENERY_PATH, "scenery.json"));
}

} // namespace floormat