Snake/back-end/guiobjectfactory.cpp

16 lines
307 B
C++
Raw Normal View History

2018-10-11 00:04:52 +03:00
#include "guiobjectfactory.h"
#include "box.h"
2018-10-11 18:09:35 +03:00
#include "utils.h"
#include "head.h"
2018-10-11 00:04:52 +03:00
2018-10-11 18:09:35 +03:00
GuiObjectFactory::GuiObjectFactory() {}
2018-10-11 00:04:52 +03:00
ItemWorld *GuiObjectFactory::generate(const QString &name) {
ItemWorld *obj = nullptr;
if (name == "Box") {
2018-11-25 03:24:41 +03:00
obj = new Box(rand() % 400, 0);
2018-10-11 00:04:52 +03:00
}
return obj;
}