|
Eile Mit Weile
|
Represents a ladder space on the board. More...
#include <LadderSpace.hpp>
Public Member Functions | |
| LadderSpace (unsigned space_idx, int color) | |
| Color | GetColor () const |
| unsigned | GetTypeOfSpace () const override |
| void | WriteIntoJson (rapidjson::Value &json, rapidjson::Document::AllocatorType &allocator) const override |
Public Member Functions inherited from Space | |
| Space (unsigned space_idx, std::vector< Figure * > figures=std::vector< Figure * >(0)) | |
| ~Space () | |
| virtual unsigned | AddFigure (Figure *figure) |
| virtual Figure * | RemoveFigure (Figure *figure) |
| virtual std::vector< Figure * > | GetFigures () |
| unsigned | GetSpaceIdx () const |
| virtual bool | IsBlocked () const |
| void | WriteIntoJson (rapidjson::Value &json, rapidjson::Document::AllocatorType &allocator) const override |
Public Member Functions inherited from UniqueSerializable | |
| std::string | GetId () const |
| void | WriteIntoJson (rapidjson::Value &json, rapidjson::MemoryPoolAllocator< rapidjson::CrtAllocator > &allocator) const override |
Public Member Functions inherited from Serializable | |
| virtual rapidjson::Document * | ToJson () const |
Static Public Member Functions | |
| static LadderSpace * | FromJson (const rapidjson::Value &json) |
Private Member Functions | |
| LadderSpace (std::string id, unsigned space_idx, std::vector< Figure * > figures, int color) | |
Private Attributes | |
| Color | _color |
Additional Inherited Members | |
Protected Member Functions inherited from Space | |
| Space (std::string id, unsigned space_idx, std::vector< Figure * > figures) | |
Protected Member Functions inherited from UniqueSerializable | |
| UniqueSerializable () | |
| UniqueSerializable (std::string id) | |
Protected Attributes inherited from Space | |
| std::vector< Figure * > | _figures |
| unsigned | _space_idx |
Protected Attributes inherited from UniqueSerializable | |
| std::string | id |
Represents a ladder space on the board.
On ladder spaces, figures are safe from being kicked back to home by getting a 6 from a dice roll 3 times in a row. A figure only enters the ladder space if its color corresponds to the color of the ladder space (_color).
Constructor: creates a LadderSpace with a space index and a color (_color)
|
private |
Deserialization constructor used by FromJson
|
static |
Deserializes a LadderSpace object from a json object. Used by client.
|
overridevirtual |
Returns the type of the space. For ladder spaces this is 4.
Reimplemented from Space.
|
overridevirtual |
Serializes a LadderSpace object into a json object. Used by server.
Implements Serializable.
|
private |
The Color of the ladder space. Used to identify the player that owns the ladder space.