CSCI 3081 - Drone Delivery System
|
This is a derived class from IEntityFactory to manage all other factories (e.g. DroneFactory, PackageFactory, CustomerFactory...) More...
#include <composite_factory.h>
Public Member Functions | |
CompositeFactory () | |
Constructor: this can do any setup your system necessitates. | |
~CompositeFactory () | |
Destructor: this tear down/reset the memory space related to pointers. | |
void | AddFactory (IEntityFactory *) |
This adds an IEntityFactory factory into the vector factories of composite class. More... | |
IEntity * | CreateEntity (const picojson::object &val) |
This is an inheritance function from IEntityFactory to create an approxiate Entity object based on the argument pass in Given the picojson::object val, this should create an entity. Based on the type of entity, there may be different fields. You can see the vals that will be passed in the project/web/scenes directory. Some of the fields are for our backend system and you don't need to worry about them. (for instance, mesh, rotation, offset, etc.) Some fields in val that you will need to create the entity correctly: More... | |
This is a derived class from IEntityFactory to manage all other factories (e.g. DroneFactory, PackageFactory, CustomerFactory...)
void csci3081::CompositeFactory::AddFactory | ( | IEntityFactory * | n | ) |
This adds an IEntityFactory factory into the vector factories of composite class.
[in] | n | a IEntityFactory pointer that want to be added into the vector |
|
virtual |
This is an inheritance function from IEntityFactory to create an approxiate Entity object based on the argument pass in Given the picojson::object val, this should create an entity. Based on the type of entity, there may be different fields. You can see the vals that will be passed in the project/web/scenes directory. Some of the fields are for our backend system and you don't need to worry about them. (for instance, mesh, rotation, offset, etc.) Some fields in val that you will need to create the entity correctly:
type: string (could be "drone/customer/package")
name: string
position: array (contains [x_position, y_position, z_position])
direction: array (contains [x, y, z])
speed: float
battery_capacity: float
[in] | val | the picojson::object that constains all of the necessary |
Implements entity_project::IEntityFactory.