diff options
| author | Mel <einebeere@gmail.com> | 2024-01-25 11:25:29 +0100 |
|---|---|---|
| committer | Mel <einebeere@gmail.com> | 2024-01-25 11:25:29 +0100 |
| commit | 66e436d0f2cf3c33105d8a5bce43bf64d5e72255 (patch) | |
| tree | 3ee36001907453336cf96a57d8ec0154a9ae3135 /src/World/BlockType.hpp | |
| parent | efd17623627607a26f33dac8f7ef1a1ddc931907 (diff) | |
| download | meowcraft-66e436d0f2cf3c33105d8a5bce43bf64d5e72255.tar.zst meowcraft-66e436d0f2cf3c33105d8a5bce43bf64d5e72255.zip | |
Mostly functioning world collisions
Diffstat (limited to 'src/World/BlockType.hpp')
| -rw-r--r-- | src/World/BlockType.hpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/World/BlockType.hpp b/src/World/BlockType.hpp index 2a9a652..cfac43b 100644 --- a/src/World/BlockType.hpp +++ b/src/World/BlockType.hpp @@ -26,6 +26,16 @@ public: operator Value() const { return m_block; } + Bool is_solid() const { + switch (m_block) { + case Air: + case Water: + return false; + default: + return true; + } + } + Bool is_translucent() const { return opacity() != 1.0; } Real opacity() const { @@ -58,4 +68,4 @@ private: Value m_block; }; -} \ No newline at end of file +} |
