Skip to content

Obiektowosc#3 Lesson fixes #72

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 17, 2020
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
10 changes: 5 additions & 5 deletions module2/presentation_solutions.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ public:
Coordinates(size_t pos_x, size_t pos_y)
: pos_x_(pos_x), pos_y_(pos_y) {}

bool operator==(const Coordinates& lhs) const {
return this->pos_x_ == lhs.pos_x_ && this->pos_y_ == lhs.pos_y_;
bool operator==(const Coordinates& rhs) const {
return this->pos_x_ == rhs.pos_x_ && this->pos_y_ == rhs.pos_y_;
}

private:
Expand Down Expand Up @@ -247,11 +247,11 @@ Cargo* Player::getCargo(size_t index) const {
}

size_t Player::getAvailableSpace() const {
available_space_ = 0;
size_t total_cargo_amount = 0;
for (const auto cargo : ship_->getCargos()) {
available_space_ += cargo->getAmount();
total_cargo_amount += cargo->getAmount();
}

available_space_ = ship_->getCapacity() - total_cargo_amount;
return available_space_;
}
```
Expand Down
Empty file added shm/CMakeLists.txt
Empty file.