summaryrefslogtreecommitdiffhomepage
path: root/src/tile.hpp
diff options
context:
space:
mode:
authorStanislaw Halik <sthalik@misaki.pl>2022-12-02 14:44:32 +0100
committerStanislaw Halik <sthalik@misaki.pl>2022-12-02 14:46:59 +0100
commit889d2c0c0933cf2fd9e068b1d2b79eb936b29b58 (patch)
treecfc5f5b6e417c28482734645a69e0d49388fa5b3 /src/tile.hpp
parent8dbf450e34121358992e48212ae22cb7f5fc92f9 (diff)
src, serialize: work on pass mode
1. add one more value to the enum 2. serialize it properly in binary 3. serialize it as string in json
Diffstat (limited to 'src/tile.hpp')
-rw-r--r--src/tile.hpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/src/tile.hpp b/src/tile.hpp
index 387f7ff0..543b70b6 100644
--- a/src/tile.hpp
+++ b/src/tile.hpp
@@ -1,15 +1,13 @@
#pragma once
#include "tile-image.hpp"
#include "scenery.hpp"
+#include "pass-mode.hpp"
namespace floormat {
struct chunk;
struct anim_atlas;
-// zero is the default, see bitset in chunk.hpp
-enum pass_mode : unsigned char { pass_shoot_through, pass_ok, pass_blocked, };
-
struct pass_mode_ref final
{
pass_mode_ref(chunk& c, std::uint8_t i) noexcept;
@@ -28,7 +26,7 @@ struct tile_proto final
std::shared_ptr<anim_atlas> scenery_atlas;
variant_t ground_variant = 0, wall_north_variant = 0, wall_west_variant = 0;
struct scenery scenery_frame;
- enum pass_mode pass_mode = pass_mode::pass_shoot_through;
+ pass_mode passability = pass_mode{0};
tile_image_proto ground() const noexcept;
tile_image_proto wall_north() const noexcept;
@@ -62,8 +60,8 @@ struct tile_ref final
std::shared_ptr<const tile_atlas> wall_west_atlas() const noexcept;
std::shared_ptr<const anim_atlas> scenery_atlas() const noexcept;
- pass_mode_ref pass_mode() noexcept;
- enum pass_mode pass_mode() const noexcept;
+ pass_mode_ref passability() noexcept;
+ pass_mode passability() const noexcept;
explicit operator tile_proto() const noexcept;