NetDEM v1.0
|
A command class to create an object in the simulation. More...
#include <command_create.hpp>
Public Member Functions | |
CommandCreate (nlohmann::json const &info, Simulation *sim) | |
Constructs a new CommandCreate object with the given information and simulation object. | |
void | Execute () override |
Creates the object in the simulation. | |
Public Member Functions inherited from netdem::Command | |
Command (nlohmann::json const &info, Simulation *sim) | |
Constructs a new Command object with the given information and simulation object. | |
virtual | ~Command () |
Destroys the Command object. | |
Additional Inherited Members | |
Public Attributes inherited from netdem::Command | |
nlohmann::json | info |
The information associated with the command. | |
Simulation * | sim |
A pointer to the simulation object. | |
A command class to create an object in the simulation.
With the input parameters defined in json, create and insert a sphere shape into a simulation.
The CommandCreate
class is a command class that creates an object in the simulation based on the provided JSON information. It inherits from the Command
base class and implements the Execute()
function to create the object in the simulation.
netdem::CommandCreate::CommandCreate | ( | nlohmann::json const & | info, |
Simulation * | sim ) |
Constructs a new CommandCreate
object with the given information and simulation object.
This constructor creates a new CommandCreate
object with the given information and simulation object.
info | The information associated with the command. |
sim | A pointer to the simulation object. |
|
overridevirtual |
Creates the object in the simulation.
This function creates the object in the simulation as specified by the JSON information in the info
member variable. It overrides the Execute()
function of the Command
base class.
Implements netdem::Command.