NLS Engine  v0.1
The Next Logical Step in game engine design.
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Defines
ModuleInterface.h
Go to the documentation of this file.
00001 
00007 #pragma once
00008 
00009 // Standard Includes
00010 #include <string>
00011 #include <map>
00012 
00013 // Library Includes
00014 #include <boost/any.hpp>
00015 #include <boost/function.hpp>
00016 
00017 // Local Includes
00018 #include "Entity_fwd.h"
00019 #include "EventLogger.h"
00020 
00021 // Forward Declarations
00022 class PropertyMap;
00023 class ComponentInterface;
00024 class MessageRouter;
00025 class Envelope;
00026 class EntityList;
00027 
00028 // Typedefs
00029 
00030 class ModuleInterface { // All systems derive from this
00031 public:
00032   ModuleInterface(PropertyMap* gprops, MessageRouter* msgrouter, EntityList* elist = nullptr) : msgrouter(msgrouter), gprops(gprops), elist(elist) { };
00033   virtual ~ModuleInterface(void) { }
00034 
00035   virtual void Update(double dt) = 0; // Called each game update with change in time (dt) in milliseconds since last update
00036 
00037   virtual void CreateComponent(std::string, std::map< std::string, boost::any > &, EntitySPTR) = 0; // Called to create a component of type (type), with the set of attributes (attributes), and with parent entity (e)
00038 
00039   virtual WHO_DELETES::TYPE RemoveComponent(ComponentInterface*) = 0;
00040 
00041 protected:
00042   MessageRouter* msgrouter;
00043   PropertyMap* gprops;
00044   EntityList* elist;
00045 };