#include "shared/world/block.hh" namespace shared { namespace world { enum block::visibility block::get_visibility(const enum block::type type) noexcept { switch (type) { case type::air: return visibility::invisible; case type::shrub: case type::dead_shrub: case type::leaves: case type::snowy_leaves: case type::snowy_shrub: return visibility::partial; case type::water: return visibility::translucent; default: break; } return visibility::solid; } bool block::is_tangible(const enum block::type type) noexcept { switch (type) { case type::air: case type::shrub: case type::dead_shrub: case type::snowy_shrub: return false; default: break; } return true; } bool block::is_collidable(const enum block::type type) noexcept { switch (type) { case type::air: case type::shrub: case type::dead_shrub: case type::snowy_shrub: case type::water: return false; default: break; } return true; } bool block::is_liquid(const enum block::type type) noexcept { switch (type) { case type::water: return true; default: break; } return false; } bool block::is_replaceable(const enum block::type type) noexcept { switch (type) { case type::water: case type::air: return true; default: break; } return false; } bool block::is_removable(const enum block::type type) noexcept { switch (type) { case type::water: case type::air: return false; default: break; } return true; } } // namespace world } // namespace shared