summaryrefslogtreecommitdiffhomepage
path: root/src/tile.hpp
blob: d607a2d365ce5ed96571e8675a868a9124145d26 (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
#pragma once
#include "compat/defs.hpp"
#include "compat/assert.hpp"
#include "tile-defs.hpp"
#include <Magnum/Magnum.h>
#include <Magnum/Math/Vector3.h>
#include <cstdint>
#include <memory>

namespace Magnum::Examples {

struct tile_atlas;

struct tile_image final
{
    std::shared_ptr<tile_atlas> atlas;
    std::uint8_t variant = 0xff;

    explicit operator bool() const noexcept { return !!atlas; }
};

struct tile final
{
    enum class pass_mode : std::uint8_t { pass_blocked, pass_ok, pass_shoot_through, };
    using enum pass_mode;

    tile_image ground_image, wall_north, wall_west;
    pass_mode passability = pass_shoot_through;

    constexpr tile() = default;
    DECLARE_DEPRECATED_COPY_OPERATOR(tile);
};

} //namespace Magnum::Examples