Eile Mit Weile
Loading...
Searching...
No Matches
NormalSpace Class Reference

Represents a normal space on the board. More...

#include <NormalSpace.hpp>

Inheritance diagram for NormalSpace:
Space UniqueSerializable Serializable

Public Member Functions

 NormalSpace (unsigned space_idx)
 
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 FigureRemoveFigure (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::DocumentToJson () const
 

Static Public Member Functions

static NormalSpaceFromJson (const rapidjson::Value &json)
 

Private Member Functions

 NormalSpace (std::string id, unsigned space_idx, std::vector< Figure * > figures)
 

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
 

Detailed Description

Represents a normal space on the board.

Normal spaces are the most common spaces on the board. They have no special functionality.

Constructor & Destructor Documentation

◆ NormalSpace() [1/2]

NormalSpace::NormalSpace ( unsigned  space_idx)
explicit

Constructor: creates a NormalSpace with a space index

◆ NormalSpace() [2/2]

NormalSpace::NormalSpace ( std::string  id,
unsigned  space_idx,
std::vector< Figure * >  figures 
)
private

Deserialization constructor used by FromJson

Member Function Documentation

◆ FromJson()

NormalSpace * NormalSpace::FromJson ( const rapidjson::Value json)
static

Deserializes a NormalSpace object from a json object. Used by client.

◆ GetTypeOfSpace()

unsigned int NormalSpace::GetTypeOfSpace ( ) const
overridevirtual

Returns the type of the space. For normal spaces this is 0. Currently never used as normal spaces have no special functionality.

Reimplemented from Space.

◆ WriteIntoJson()

void NormalSpace::WriteIntoJson ( rapidjson::Value json,
rapidjson::Document::AllocatorType &  allocator 
) const
overridevirtual

Serializes a NormalSpace object into a json object. Used by server.

Implements Serializable.


The documentation for this class was generated from the following files: