File tree Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Expand file tree Collapse file tree 2 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -69,8 +69,8 @@ public:
69
69
Coordinates(size_t pos_x, size_t pos_y)
70
70
: pos_x_(pos_x), pos_y_(pos_y) {}
71
71
72
- bool operator==(const Coordinates& lhs ) const {
73
- return this->pos_x_ == lhs .pos_x_ && this->pos_y_ == lhs .pos_y_;
72
+ bool operator==(const Coordinates& rhs ) const {
73
+ return this->pos_x_ == rhs .pos_x_ && this->pos_y_ == rhs .pos_y_;
74
74
}
75
75
76
76
private:
@@ -247,11 +247,11 @@ Cargo* Player::getCargo(size_t index) const {
247
247
}
248
248
249
249
size_t Player::getAvailableSpace() const {
250
- available_space _ = 0;
250
+ size_t total_cargo_amount = 0;
251
251
for (const auto cargo : ship_ ->getCargos()) {
252
- available_space _ += cargo->getAmount();
252
+ total_cargo_amount += cargo->getAmount();
253
253
}
254
-
254
+ available_space _ = ship _ ->getCapacity() - total_cargo_amount;
255
255
return available_space_ ;
256
256
}
257
257
```
You can’t perform that action at this time.
0 commit comments