Entities improvement

This commit is contained in:
Andrew nuark G 2020-12-15 21:44:41 +07:00
parent 19f223b474
commit 76ac624519
11 changed files with 39 additions and 27 deletions

View file

@ -1,13 +1,13 @@
#include "vessel_entity.h"
unsigned long long vessel_entity::__global_id = 0;
entity_id vessel_entity::__global_id = 0;
vessel_entity::vessel_entity(const dpoint_entity &harbor, unsigned int capacity) : _harbor(harbor), _capacity(capacity) {
this->_id = ++vessel_entity::__global_id;
}
unsigned long long vessel_entity::id() {
entity_id vessel_entity::id() {
return this->_id;
}
@ -42,3 +42,7 @@ void vessel_entity::deserialize(QDataStream &input) {
this->_cargo[i].deserialize(input);
}
}
void vessel_entity::preloadGlobalId(entity_id gid) {
vessel_entity::__global_id = gid;
}