35 lines
818 B
C++
35 lines
818 B
C++
#ifndef STORAGE_ENTITY_H
|
|
#define STORAGE_ENTITY_H
|
|
|
|
#include "IEntity.h"
|
|
#include "cargo_entity.h"
|
|
|
|
#include <QVector>
|
|
#include <QCryptographicHash>
|
|
|
|
|
|
class storage_entity : public IEntity {
|
|
private:
|
|
static unsigned long long __global_id;
|
|
|
|
unsigned long long _id;
|
|
unsigned int _capacity;
|
|
QVector<cargo_entity> _cargo;
|
|
|
|
public:
|
|
storage_entity() = default;
|
|
storage_entity(unsigned int capacity);
|
|
|
|
unsigned long long id();
|
|
unsigned int capacity();
|
|
const QVector<cargo_entity> cargo();
|
|
|
|
void add_cargo(cargo_entity object, bool &success);
|
|
cargo_entity get_cargo(unsigned long long oid, bool &found);
|
|
void withdraw_cargo(unsigned long long oid, bool &success);
|
|
|
|
void serialize(QDataStream &output);
|
|
void deserialize(QDataStream &input);
|
|
};
|
|
|
|
#endif // STORAGE_ENTITY_H
|