Add docs for entities
This commit is contained in:
parent
5c1f937793
commit
4bbb286981
7 changed files with 359 additions and 2 deletions
|
|
@ -8,25 +8,68 @@
|
|||
#include <QCryptographicHash>
|
||||
|
||||
|
||||
/**
|
||||
* @brief Cargo entity class
|
||||
*
|
||||
*/
|
||||
class cargo_entity : public IEntity {
|
||||
private:
|
||||
//! Global static ID for cargo
|
||||
static entity_id __global_id;
|
||||
|
||||
//! Cargo's ID
|
||||
entity_id _id = 0;
|
||||
//! Cargo title
|
||||
QString _title;
|
||||
//! Cargo volume
|
||||
unsigned int _volume = 50000;
|
||||
|
||||
public:
|
||||
/**
|
||||
* @brief Construct a new cargo entity object
|
||||
*
|
||||
*/
|
||||
cargo_entity();
|
||||
/**
|
||||
* @brief Construct a new cargo entity object
|
||||
*
|
||||
* @param title cargo title
|
||||
* @param volume cargo volume
|
||||
*/
|
||||
cargo_entity(const QString &title, unsigned int volume);
|
||||
|
||||
/**
|
||||
* @brief Get cargo's ID
|
||||
*
|
||||
* @return entity_id
|
||||
*/
|
||||
entity_id id() const;
|
||||
/**
|
||||
* @brief Get cargo's title
|
||||
*
|
||||
* @return QString
|
||||
*/
|
||||
QString title() const;
|
||||
/**
|
||||
* @brief Get cargo's volume
|
||||
*
|
||||
* @return unsigned int
|
||||
*/
|
||||
unsigned int volume() const;
|
||||
|
||||
void serialize(QDataStream &output);
|
||||
void deserialize(QDataStream &input);
|
||||
/**
|
||||
* @brief Sets GID of class
|
||||
*
|
||||
* @param gid new class GID
|
||||
*/
|
||||
static void preloadGlobalId(entity_id gid);
|
||||
/**
|
||||
* @brief Returns GID of class
|
||||
*
|
||||
* @return entity_id
|
||||
*/
|
||||
static entity_id GID();
|
||||
};
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue