我SystemManager
已地图System
类,其中每个系统被映射到输入systype
无法声明字段“对”是
typedef string systype;
在标题文件的,这map
被声明抽象类型“系统”的:
class SystemManager
{
public:
SystemManager();
~SystemManager();
map<systype, System> systems;
System* getSystemPointer(systype);
};
我尝试将DrawSystem
(从System
派生类)添加在构造函数中我的“系统图”:
SystemManager::SystemManager()
{
systems["Draw"] = DrawSystem();
}
这给我的错误:
cannot declare filed '
pair<systype, System>::second
' to be of abstract type System
我想不出是什么原因造成的。
这里是我的System
和DrawSystem
班情况的事项:
class System
{
public:
System();
systype type;
vector<cptype> args;
virtual void update(vector<Cp*>) = 0; //= 0 is for pure virtual function
};
class DrawSystem : public System
{
friend class Game; //allows to draw on render window
public:
DrawSystem();
void update(vector<Cp*>);
};