CSCI 3081 - Drone Delivery System
asubject.h
1 
4 /*******************************************************************************
5  * Includes
6  ******************************************************************************/
7 #include <string>
8 #include <vector>
9 #include <EntityProject/entity_observer.h>
10 #include <EntityProject/entity.h>
11 #include "json_helper.h"
12 
13 namespace csci3081 {
14 
15 /*******************************************************************************
16  * Class Definitions
17  ******************************************************************************/
22  class ASubject{
23  public:
29 
35 
40  std::vector <entity_project::IEntityObserver*> GetList();
41 
47  void Notify(picojson::value& event, const entity_project::IEntity& entity);
48 
56  virtual void GetStatus() = 0;
57 
71  virtual void Update(float dt) = 0;
72 
73  protected:
77  std::vector <entity_project::IEntityObserver*> list;
78  };
79 } // namespace 3081
std::vector< entity_project::IEntityObserver * > GetList()
Getter function for the list of observers (mostly used in testing)
Definition: asubject.cc:10
void Detach(entity_project::IEntityObserver *observer)
Deletes an observer from the list of observers for this subject.
Definition: asubject.cc:7
virtual void GetStatus()=0
Pure virtual function GetStatus that needs to implemented by derived class based on their types of no...
void Notify(picojson::value &event, const entity_project::IEntity &entity)
Sends out Notification to the observer watching this subject.
Definition: asubject.cc:13
Definition: asubject.cc:3
virtual void Update(float dt)=0
Pure virtual function Update that needs to implemented by derived class based on their entity type...
void Attach(entity_project::IEntityObserver *observer)
Adds an observer to the list of observers for this subject.
Definition: asubject.cc:4
A movable object in a scene. Entities have position, direction and size.
Definition: entity.h:15
Observers entity events when they occur.
Definition: entity_observer.h:14
std::vector< entity_project::IEntityObserver * > list
List of pointers to the observers for this subject.
Definition: asubject.h:77
This is the Abstract Subject class from which our subjects will inherit Implements the Observer/subje...
Definition: asubject.h:22