|
|
| Command_replace_module (ObjectId id) |
| |
| virtual bool | performCommand () final |
| |
| nlohmann::json | toJson () |
| | serialize the current object to JSON object
|
| |
| bool | writeToJsonFile () |
| | Write to the storage folder a file (see _create_filename() below) containing the object in JSON format.
|
| |
| DataItem & | addDataItem (const std::string &dataItem) |
| | Add a dataItem, and return a reference to it.
|
| |
| bool | hasDataItem (const std::string &dataItem) const |
| | Check if a specific data item exist.
|
| |
| DataItem & | accessDataItem (const std::string &dataItem) |
| | get a reference to the dataItem
|
| |
| const DataItem & | accessDataItem (const std::string &dataItem) const |
| | get a const reference to the dataItem
|
| |
| void | dataItemsFromTemplate (const nlohmann::json &template_data) |
| | Initialize a list of dataitems from a JSON template.
|
| |
| const std::string & | category () const |
| | return the object category (starsystemobject, module, command...)
|
| |
| const std::string & | type () const |
| | return the type (ship_xxx, station_xxx, planet_xxx...)
|
| |
| ObjectId | id () const |
| | return the object unique ID
|
| |
| void | reparent (std::shared_ptr< GameObject > new_parent) |
| | reparent from the current parent, to a new one
|
| |
|
void | lock () |
| |
|
void | unlock () |
| |
| std::shared_ptr< GameObject > | getParent () const |
| | return pointer to this object parent
|
| |
| template<typename T> |
| std::shared_ptr< T > | getParent () const |
| | return pointer to this object parent
|
| |
| std::shared_ptr< GameObject > | getSibling (ObjectId id) |
| | get sibling with given ID
|
| |
| template<typename T> |
| std::shared_ptr< T > | getSibling (ObjectId id) |
| | get sibling with given ID
|
| |
| std::shared_ptr< GameObject > | getChild (ObjectId id) |
| | return the child to match the id
|
| |
| template<typename T> |
| std::shared_ptr< T > | getChild (ObjectId id) |
| | return the child to match the id
|
| |
| bool | hasChild (ObjectId id) |
| | check if current object has a child with this id
|
| |
| std::map< ObjectId, std::shared_ptr< GameObject > > & | childrenMap () |
| | get a direct reference to the children map
|
| |
|
virtual void | tick (double, double) |
| |
|
|
static Command * | createFromDump (ObjectId id) |
| |
|
static Command * | createFromNetwork (const nlohmann::json &command_data) |
| |
Static Public Member Functions inherited from Command |
|
static std::shared_ptr< Command > | createFromDump (ObjectId id, const std::string &type) |
| |
|
static std::shared_ptr< Command > | createFromNetwork (ObjectId player_id, const nlohmann::json &command_json) |
| |
| static bool | initialize (const std::string &storage_path) |
| | initialize the disk serialization process
|
| |
| static void | registerSubtype (const std::string &category, undumpFactory undumpCb) |
| | Static function that needs to be called for each derived class to create types autmatically while undumping from JSON.
|
| |
| template<typename T> |
| static std::shared_ptr< T > | createFromJsonFile (const std::string &category, ObjectId id) |
| | create a GameObject object from a JSON file
|
| |