Entities update
This commit is contained in:
parent
4a3951938a
commit
05776f19f3
6 changed files with 18 additions and 7 deletions
|
|
@ -53,7 +53,7 @@
|
|||
<enum>QTabWidget::Rounded</enum>
|
||||
</property>
|
||||
<property name="currentIndex">
|
||||
<number>2</number>
|
||||
<number>0</number>
|
||||
</property>
|
||||
<property name="documentMode">
|
||||
<bool>false</bool>
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
#include "dpoint_entity.h"
|
||||
|
||||
dpoint_entity::dpoint_entity(const QString &title) : _title(title) {
|
||||
this->_id = 0;
|
||||
dpoint_entity::dpoint_entity(entity_id dispatcher_id, const QString &title) : _dispatcher_id(dispatcher_id), _title(title) {
|
||||
this->_id = dispatcher_id;
|
||||
auto hash = QCryptographicHash::hash(title.toLocal8Bit(), QCryptographicHash::Md5);
|
||||
for (auto bit : hash) {
|
||||
this->_id += bit;
|
||||
|
|
@ -12,6 +12,10 @@ entity_id dpoint_entity::id() const {
|
|||
return this->_id;
|
||||
}
|
||||
|
||||
entity_id dpoint_entity::dispatcher() const {
|
||||
return this->_dispatcher_id;
|
||||
}
|
||||
|
||||
QString dpoint_entity::title() const {
|
||||
return this->_title;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -12,14 +12,16 @@
|
|||
class dpoint_entity : public IEntity {
|
||||
private:
|
||||
entity_id _id;
|
||||
entity_id _dispatcher_id;
|
||||
QString _title;
|
||||
QVector<storage_entity> _storages;
|
||||
|
||||
public:
|
||||
dpoint_entity() = default;
|
||||
dpoint_entity(const QString &title);
|
||||
dpoint_entity(entity_id dispatcher_id, const QString &title);
|
||||
|
||||
entity_id id() const;
|
||||
entity_id dispatcher() const;
|
||||
QString title() const;
|
||||
const QVector<storage_entity> storages();
|
||||
|
||||
|
|
|
|||
|
|
@ -11,6 +11,10 @@ entity_id vessel_entity::id() const {
|
|||
return this->_id;
|
||||
}
|
||||
|
||||
entity_id vessel_entity::skipper() const {
|
||||
return this->_skipper_id;
|
||||
}
|
||||
|
||||
entity_id vessel_entity::harbor() const {
|
||||
return this->_harbor_id;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -21,6 +21,7 @@ public:
|
|||
vessel_entity(entity_id skipper_id, entity_id harbor_id, unsigned int capacity);
|
||||
|
||||
entity_id id() const;
|
||||
entity_id skipper() const;
|
||||
entity_id harbor() const;
|
||||
unsigned int capacity() const;
|
||||
const QVector<cargo_entity> cargo();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue