Class Object

Class Documentation

class Object

Represents an object. An object contains a block, and so this class is mainly used to faclitate deeper semantic separation than the Block class.

Public Functions

void shiftX(int shift)

Shift the x value by a given amount.

Parameters

shift – The amount to shift by which may be positive or negative

void shiftY(int shift)

Shift the y value by a given amount.

Parameters

shift – The amount to shift by which may be positive or negative

void shiftZ(int shift)

Shift the z value by a given amount.

Parameters

shift – The amount to shift by which may be positive or negative

void shift(int shiftX, int shiftY, int shiftZ)

Shift the x,y and z values by given amounts.

Parameters
  • shiftX – The amount to shift x by which may be positive or negative

  • shiftY – The amount to shift x by which may be positive or negative

  • shiftZ – The amount to shift x by which may be positive or negative

virtual void toSemanticMapJSON(nlohmann::json &json_base)

Adds the JSON representation of this object to the “objects” list of the base json.

Returns

nlohmann::json The base json

virtual void toLowLevelMapJSON(nlohmann::json &json_base)

Adds the block JSON representation of this object to the “blocks” list of the base json.

Returns

nlohmann::json The base json

Object(std::string id, std::string type, std::unique_ptr<Block> block)

Construct a new Object object.

Parameters
  • id – The id to give this object

  • type – The type for this object

  • block – The block associated with this object

~Object()

Destroy the Object object.