Eile Mit Weile
Loading...
Searching...
No Matches
BenchSpace.hpp
1#ifndef EILEMITWEILE_BENCHSPACE_HPP
2#define EILEMITWEILE_BENCHSPACE_HPP
3
4#include "Space.hpp"
5
15class BenchSpace: public Space {
16 public:
17 explicit BenchSpace(unsigned space_idx);
18 void SetBlock();
19 void FreeBlock();
20 [[nodiscard]] bool IsBlocked() const override;
21 unsigned int AddFigure(Figure *figure) override;
23 Figure* RemoveFigure(Figure *figure) override;
25 [[nodiscard]] unsigned GetTypeOfSpace() const override;
26 static BenchSpace* FromJson(const rapidjson::Value& json);
27 void WriteIntoJson(rapidjson::Value& json, rapidjson::Document::AllocatorType& allocator) const override;
29 private:
31 BenchSpace(std::string id, unsigned space_idx, std::vector<Figure*> figures, bool is_blocked);
32};
33
34
35#endif //EILEMITWEILE_BENCHSPACE_HPP
Represents a bench space on the board.
Definition BenchSpace.hpp:15
bool IsBlocked() const override
Definition BenchSpace.cpp:35
static BenchSpace * FromJson(const rapidjson::Value &json)
Definition BenchSpace.cpp:44
BenchSpace(unsigned space_idx)
unsigned int AddFigure(Figure *figure) override
Definition BenchSpace.cpp:67
void WriteIntoJson(rapidjson::Value &json, rapidjson::Document::AllocatorType &allocator) const override
Definition BenchSpace.cpp:59
bool _is_blocked
Definition BenchSpace.hpp:30
void SetBlock()
Definition BenchSpace.cpp:15
unsigned GetTypeOfSpace() const override
Definition BenchSpace.cpp:40
Figure * RemoveFigure(Figure *figure) override
Definition BenchSpace.cpp:75
BenchSpace(std::string id, unsigned space_idx, std::vector< Figure * > figures, bool is_blocked)
void FreeBlock()
Definition BenchSpace.cpp:25
Represents a figure on the board.
Definition Figure.hpp:16
Abstract Base Class. Represents a space on the board.
Definition Space.hpp:28