Files
shenzhen-solitaire/shenzhen_solitaire/c++/include/board.hpp
Lukas Wölfer 5af5282aab Worked on c++
2020-03-20 00:12:32 +01:00

35 lines
713 B
C++

#pragma once
#include "card.hpp"
#include "goal.hpp"
#include <array>
#include <cassert>
#include <optional>
namespace solitaire {
struct BunkerField {
std::optional<Card> card;
bool empty{};
bool closed{};
};
inline constexpr int MAX_ROW_SIZE = 13;
inline constexpr int MAX_COLUMN_SIZE = 8;
class Stack {
std::array<std::optional<Card>, MAX_COLUMN_SIZE> values{};
};
struct Board {
std::array<Stack, MAX_ROW_SIZE> field{};
std::array<BunkerField, 3> bunker{};
Goal goal{};
bool flower_gone{};
[[nodiscard]] auto solved() const noexcept -> bool;
[[nodiscard]] auto hash() const noexcept -> std::size_t;
[[nodiscard]] auto correct() const noexcept -> bool;
};
} // namespace solitaire