Improved dpoint entity interactions
This commit is contained in:
parent
96a8e7c586
commit
44ccc07360
2 changed files with 15 additions and 6 deletions
|
|
@ -16,14 +16,22 @@ QString dpoint_entity::title() {
|
|||
return this->_title;
|
||||
}
|
||||
|
||||
const QVector<entity_id> dpoint_entity::storages_ids() {
|
||||
return this->_storages_ids;
|
||||
const QVector<storage_entity> dpoint_entity::storages() {
|
||||
return this->_storages;
|
||||
}
|
||||
|
||||
void dpoint_entity::serialize(QDataStream &output) {
|
||||
output << this->_id << this->_title << this->_storages_ids;
|
||||
output << this->_id << this->_title << this->_storages.size();
|
||||
for (auto &item : this->_storages) {
|
||||
item.serialize(output);
|
||||
}
|
||||
}
|
||||
|
||||
void dpoint_entity::deserialize(QDataStream &input) {
|
||||
input >> this->_id >> this->_title >> this->_storages_ids;
|
||||
int icnt;
|
||||
input >> this->_id >> this->_title >> icnt;
|
||||
this->_storages.resize(icnt);
|
||||
for (int i = 0; i < icnt; i++) {
|
||||
this->_storages[i].deserialize(input);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue