Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions shm/cargo.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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_;
Expand Down
3 changes: 3 additions & 0 deletions shm/ship.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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);
Expand Down