1 #ifndef WEB_SCENE_VIEWER_H_ 2 #define WEB_SCENE_VIEWER_H_ 7 #include "EntityProject/scene_viewer.h" 8 #include "EntityProject/entity_observer.h" 17 struct WebSceneViewerState;
23 WebSceneViewer(
int port,
const std::string& webDir,
const std::string& scene);
39 void SendJSON(
const picojson::value& json);
46 WebSceneViewerState* state;
IEntitySystem * entitySystem_
The current entity system.
Definition: web_scene_viewer.h:43
void OnEvent(const picojson::value &event, const IEntity &entity)
Sends events to the web page over web sockets.
WebSceneViewer(int port, const std::string &webDir, const std::string &scene)
Constructor that initializes with a port and a website directory.
Abstact class for viewing a scene representing an entity system.
Definition: scene_viewer.h:14
An abstract class that represents an entity system that contains entities and updates over time...
Definition: entity_system.h:10
void SendJSON(const picojson::value &json)
Sends JSON to all web clients.
virtual ~WebSceneViewer()
Destructor.
A web viewer for the entity system that uses web sockets.
Definition: web_scene_viewer.h:20
A movable object in a scene. Entities have position, direction and size.
Definition: entity.h:15
bool Run()
Runs the web viewer.
virtual IEntitySystem * GetEntitySystem() const
Returns the current entity system.
Definition: web_scene_viewer.h:33
Observers entity events when they occur.
Definition: entity_observer.h:14
void SetEntitySystem(IEntitySystem *entitySystem)
Sets the current entity system.