Delivery point editor done
This commit is contained in:
parent
a6c080d36b
commit
3e196f3574
22 changed files with 379 additions and 74 deletions
|
|
@ -20,10 +20,28 @@ QString dpoint_entity::title() const {
|
|||
return this->_title;
|
||||
}
|
||||
|
||||
void dpoint_entity::set_title(const QString &new_title) {
|
||||
this->_title = new_title;
|
||||
}
|
||||
|
||||
const QVector<storage_entity> dpoint_entity::storages() {
|
||||
return this->_storages;
|
||||
}
|
||||
|
||||
void dpoint_entity::set_storages(QVector<storage_entity> storages) {
|
||||
this->_storages = storages;
|
||||
}
|
||||
|
||||
void dpoint_entity::remove_storage(entity_id sid) {
|
||||
std::remove_if(this->_storages.begin(), this->_storages.end(), [sid](storage_entity ent) {
|
||||
return ent.id() == sid;
|
||||
});
|
||||
}
|
||||
|
||||
void dpoint_entity::add_storage(storage_entity ent) {
|
||||
this->_storages.push_back(ent);
|
||||
}
|
||||
|
||||
void dpoint_entity::serialize(QDataStream &output) {
|
||||
output << this->_id << this->_title << this->_storages.size();
|
||||
for (auto &item : this->_storages) {
|
||||
|
|
|
|||
|
|
@ -23,7 +23,11 @@ public:
|
|||
entity_id id() const;
|
||||
entity_id dispatcher() const;
|
||||
QString title() const;
|
||||
void set_title(const QString &new_title);
|
||||
const QVector<storage_entity> storages();
|
||||
void set_storages(QVector<storage_entity> storages);
|
||||
void remove_storage(entity_id sid);
|
||||
void add_storage(storage_entity ent);
|
||||
|
||||
void serialize(QDataStream &output);
|
||||
void deserialize(QDataStream &input);
|
||||
|
|
|
|||
|
|
@ -16,6 +16,10 @@ unsigned int storage_entity::capacity() const {
|
|||
return this->_capacity;
|
||||
}
|
||||
|
||||
void storage_entity::set_capacity(unsigned int new_capacity) {
|
||||
this->_capacity = new_capacity;
|
||||
}
|
||||
|
||||
const QVector<cargo_entity> storage_entity::cargo() {
|
||||
return this->_cargo;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@ public:
|
|||
|
||||
entity_id id() const;
|
||||
unsigned int capacity() const;
|
||||
void set_capacity(unsigned int new_capacity);
|
||||
const QVector<cargo_entity> cargo();
|
||||
|
||||
void add_cargo(cargo_entity object, bool &success);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue