CSCI 3081 - Drone Delivery System
Public Member Functions | Protected Attributes | List of all members
csci3081::EntityBase Class Reference

The base class for creating entities. More...

#include <entity_base.h>

Inheritance diagram for csci3081::EntityBase:
Inheritance graph

Public Member Functions

const picojson::object & GetDetails ()
 
int GetId () const
 
const std::string & GetName ()
 
const std::vector< float > & GetPosition () const
 
const std::vector< float > & GetDirection () const
 
float GetRadius () const
 
int GetVersion () const
 
bool IsDynamic () const
 
float DistanceBetween (IEntity *another)
 
bool IsWithin (IEntity *another)
 
std::string GetType ()
 
- Public Member Functions inherited from entity_project::IEntity
virtual ~IEntity ()
 The destructor.
 

Protected Attributes

std::string name
 
int ID
 
std::vector< float > position
 
std::vector< float > direction
 
bool dynamic
 
int version
 
float radius
 
std::string type
 
picojson::object details
 

Detailed Description

The base class for creating entities.

This class can be used as the base for all entities in the delivery system. The overall design is up to you (the student), but all entities must implement the IEntity interface.

See the documentation for IEntity for more information

Member Function Documentation

◆ DistanceBetween()

float csci3081::EntityBase::DistanceBetween ( IEntity another)

Return the distance between the IEntity objects

◆ GetDetails()

const picojson::object & csci3081::EntityBase::GetDetails ( )
virtual

Returns the entity's details. The returned picojson::object should be a copy of the json that was passed in when the entity was created. Details are also used to send additional information to other subsystems (e.g. mesh, scale, rotation, etc...).

Implements entity_project::IEntity.

◆ GetDirection()

const std::vector< float > & csci3081::EntityBase::GetDirection ( ) const
virtual

Return the direction of the drone param [out]: direction of the drone as vector of float

Implements entity_project::IEntity.

◆ GetId()

int csci3081::EntityBase::GetId ( ) const
virtual

Return the unique ID of the drone param [out]: ID of the drone

Implements entity_project::IEntity.

◆ GetName()

const std::string & csci3081::EntityBase::GetName ( )
virtual

Return the name of the drone param [out]: name of the drone

Implements entity_project::IEntity.

◆ GetPosition()

const std::vector< float > & csci3081::EntityBase::GetPosition ( ) const
virtual

Return the position of the drone param [out]: position of the drone as vector of float

Implements entity_project::IEntity.

◆ GetRadius()

float csci3081::EntityBase::GetRadius ( ) const
virtual

Return the radius of the drone param [out]: radius of the drone as vector of float

Implements entity_project::IEntity.

◆ GetType()

std::string csci3081::EntityBase::GetType ( )

Return std::string type of the Entity object, such as "carrier" and "customer"

◆ GetVersion()

int csci3081::EntityBase::GetVersion ( ) const
virtual

Return the version of the drone param [out]: version of the drone as vector of float

Implements entity_project::IEntity.

◆ IsDynamic()

bool csci3081::EntityBase::IsDynamic ( ) const
virtual

Return the dynamic of the drone param [out]: dynamic of the drone as vector of float

Implements entity_project::IEntity.

◆ IsWithin()

bool csci3081::EntityBase::IsWithin ( IEntity another)

Return true if the object is within radius of the IEntity object passed in the argument; Return false otherwise


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