Snake/SnakeServer/ClientProtocol/factorynetobjects.h

33 lines
683 B
C
Raw Normal View History

2019-03-05 00:48:32 +03:00
#ifndef FACTORYNETOBJECTS_H
#define FACTORYNETOBJECTS_H
#include "clientprotocol_global.h"
#include "networkobjects.h"
namespace ClientProtocol {
class CLIENTPROTOCOLSHARED_EXPORT FactoryNetObjects {
public:
FactoryNetObjects() = delete;
2019-04-20 15:22:00 +03:00
static bool build(NetworkClasses::Type type, QVariantMap&);
static bool fillRandomData(QVariantMap &item);
2019-04-22 13:03:30 +03:00
static bool isValid(const QVariantMap &item, NetworkClasses::Type type);
2019-03-05 00:48:32 +03:00
template <typename T>
static QVariantList buildArray(const T& array) {
QVariantList res;
for (auto &&i : array) {
res.push_back(i);
}
return res;
}
};
}
#endif // FACTORYNETOBJECTS_H