summaryrefslogtreecommitdiffhomepage
path: root/src/tile-image.cpp
blob: e2d844613b1f5460cb6f17c35cd1898280874ecc (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
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#include "tile-image.hpp"

namespace floormat {

template<typename Atlas> bool image_proto_<Atlas>::operator==(const image_proto_<Atlas>& b) const noexcept = default;
template<typename Atlas> image_proto_<Atlas>::operator bool() const noexcept { return atlas != nullptr; }

template<typename Atlas, typename Proto>
image_ref_<Atlas, Proto>::operator bool() const noexcept
{
    return atlas != nullptr;
}

template<typename Atlas, typename Proto>
image_ref_<Atlas, Proto>::image_ref_(const image_ref_<Atlas, Proto>& o) noexcept
    : atlas{o.atlas}, variant{o.variant}
{}

template<typename Atlas, typename Proto>
image_ref_<Atlas, Proto>::image_ref_(std::shared_ptr<Atlas>& atlas, variant_t& variant) noexcept
    : atlas{atlas}, variant{variant}
{}

template<typename Atlas, typename Proto>
image_ref_<Atlas, Proto>::operator Proto() const noexcept
{
    return { atlas, variant };
}

template<typename Atlas, typename Proto>
image_ref_<Atlas, Proto>& image_ref_<Atlas, Proto>::operator=(const Proto& proto) noexcept
{
    atlas = proto.atlas;
    variant = proto.variant;
    return *this;
}

template struct image_proto_<ground_atlas>;
template struct image_ref_<ground_atlas, tile_image_proto>;

template struct image_proto_<wall_atlas>;
template struct image_ref_<wall_atlas, wall_image_proto>;

} // namespace floormat