All entities now have GID

This commit is contained in:
Andrew nuark G 2020-12-23 19:00:57 +07:00
parent eb097588ba
commit 2be2e9f5e3
9 changed files with 59 additions and 11 deletions

View file

@ -1,8 +1,10 @@
#include "dpoint_entity.h"
entity_id dpoint_entity::__global_id = 0;
dpoint_entity::dpoint_entity() {
this->_id += QRandomGenerator().generate64();
this->_id = ++dpoint_entity::__global_id + QRandomGenerator().generate64();
}
dpoint_entity::dpoint_entity(entity_id dispatcher_id, const QString &title) : _dispatcher_id(dispatcher_id), _title(title) {
@ -83,3 +85,11 @@ void dpoint_entity::deserialize(QDataStream &input) {
this->_storages[i].deserialize(input);
}
}
void dpoint_entity::preloadGlobalId(entity_id gid) {
dpoint_entity::__global_id = gid;
}
entity_id dpoint_entity::GID() {
return dpoint_entity::__global_id;
}