|
Eile Mit Weile
|
Represents a bench space on the board. More...
#include <BenchSpace.hpp>
Static Public Member Functions | |
| static BenchSpace * | FromJson (const rapidjson::Value &json) |
Private Member Functions | |
| BenchSpace (std::string id, unsigned space_idx, std::vector< Figure * > figures, bool is_blocked) | |
Private Attributes | |
| bool | _is_blocked |
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 bench space on the board.
On bench spaces, figures are safe from being kicked back to home by other players. Furthermore, if two figures of the same player are on the same bench space, they block all other figures of all players from moving to that space (Note this makes any dice roll that would place a figure beyond that bench space unplayable. See Board::ComputePlayableFigures).
|
explicit |
Constructor: creates a BenchSpace with a space index (Space::_space_idx)
|
private |
Deserialization constructor used by FromJson (only defined in derivatives)
| void BenchSpace::FreeBlock | ( | ) |
Sets the bench space to unblocked (_is_blocked == false).
|
static |
Deserializes a BenchSpace object from a json object. Used by client.
|
overridevirtual |
Returns the type of the space. For bench spaces this is 1.
Reimplemented from Space.
|
overridevirtual |
Indicates whether the bench space is blocked by two figures of the same player
Reimplemented from Space.
| void BenchSpace::SetBlock | ( | ) |
Sets the bench space to blocked (_is_blocked == true).
|
overridevirtual |
Serializes a BenchSpace object into a json object. Used by server.
Implements Serializable.
|
private |
Indicates whether the bench space is blocked by two figures of the same player