diff --git a/shm/cargo.hpp b/shm/cargo.hpp index fbed3dcf4..d2f2d1b3d 100644 --- a/shm/cargo.hpp +++ b/shm/cargo.hpp @@ -8,6 +8,13 @@ class Cargo Cargo &operator-=(size_t amount); bool operator==(const Cargo &cargo) const; + std::string getName() {return name_;} + size_t getAmount() {return amount_;} + size_t getBasePrice() {return basePrice_;} + + Cargo(std::string name, size_t amount, size_t basePrice) + :name_(name), amount_(amount), basePrice_(basePrice){} + protected: std::string name_; size_t amount_; diff --git a/shm/ship.hpp b/shm/ship.hpp index d81974c09..bd7cb74cf 100644 --- a/shm/ship.hpp +++ b/shm/ship.hpp @@ -6,6 +6,7 @@ class Ship { Ship() : id_(-1) {} + Ship(int capacity, int maxCrew, int speed, const std::string& name, size_t id) : capacity_(capacity) , maxCrew_(maxCrew) @@ -14,10 +15,12 @@ class Ship { , name_(name) , id_(id) {} + Ship(int maxCrew, int speed, size_t id) : Ship(0, maxCrew, speed, "", id) {} + void setName(const std::string& name) { name_ = name; } Ship& operator-=(size_t num);