summaryrefslogtreecommitdiffhomepage
path: root/loader/wall-traits.hpp
blob: 587555ef9d7adf24dc40a369e40c7de8b48565b8 (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
#pragma once
#include "atlas-loader-fwd.hpp"
#include "compat/borrowed-ptr.hpp"

namespace floormat { struct wall_cell; class wall_atlas; }

namespace floormat::loader_detail {

template<> struct atlas_loader_traits<wall_atlas>
{
    using Atlas = wall_atlas;
    using Cell = wall_cell;       // convertible to atlas and holding the atlas
    using Self = atlas_loader_traits<wall_atlas>;
    using Storage = atlas_storage<wall_atlas, Self>;

    static StringView loader_name();
    static const bptr<Atlas>& atlas_of(const Cell& x);
    static bptr<Atlas>& atlas_of(Cell& x);
    static StringView name_of(const Cell& x);
    static String& name_of(Cell& x);
    static void atlas_list(Storage& st);
    static Cell make_invalid_atlas(Storage& st);
    static bptr<Atlas> make_atlas(StringView name, const Cell& c);
    static Optional<Cell> make_cell(StringView name);
};

} // namespace floormat::loader_detail