Program Listing for File indentation.hpp

Return to documentation for file (inexor/vulkan-renderer/world/indentation.hpp)

#pragma once

#include <cstdint>

namespace inexor::vulkan_renderer::world {

class Indentation {
public:
    static constexpr std::uint8_t MAX{8};

private:
    std::uint8_t m_start{0};
    std::uint8_t m_end{Indentation::MAX};

public:
    Indentation() = default;
    Indentation(std::uint8_t start, std::uint8_t end) noexcept;
    explicit Indentation(std::uint8_t uid) noexcept;
    bool operator==(const Indentation &rhs) const;
    bool operator!=(const Indentation &rhs) const;

    void set_start(std::uint8_t position) noexcept;
    void set_end(std::uint8_t position) noexcept;

    [[nodiscard]] std::uint8_t start_abs() const noexcept;
    [[nodiscard]] std::uint8_t end_abs() const noexcept;
    [[nodiscard]] std::uint8_t start() const noexcept;
    [[nodiscard]] std::uint8_t end() const noexcept;
    [[nodiscard]] std::uint8_t offset() const noexcept;

    void indent_start(std::uint8_t steps) noexcept;
    void indent_end(std::uint8_t steps) noexcept;
    void mirror() noexcept;

    [[nodiscard]] std::uint8_t uid() const;
};

} // namespace inexor::vulkan_renderer::world