Skip to content

Conversation

@McKucia
Copy link
Collaborator

@McKucia McKucia commented Jul 1, 2020

No description provided.

Copy link
Owner

@malinaq3 malinaq3 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

2.1

#include "Store.hpp"

#include <iostream>
#include <algorithm>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

includy ustawiamy alfabetycznie

@@ -1,7 +0,0 @@
#include "Island.hpp"
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ten plik nie może zostać usunięty

@@ -1,71 +0,0 @@
# Symulator Handlu Morskiego - SHM
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ten plik nie może zostać usunięty

return *this;
}

size_t Ship::getCapacity() const {
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

gettery dublują się w hederze

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nie rozumiem

shm/Store.cpp Outdated
}
if(indexIt->get()->getAmount() == cargo->getAmount()) {
player->getShip()->getCargo().erase(indexIt);
}
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

brakuje zapłaty za sprzedany towar

cargo_.erase(found);
}
else{
(*found)->setAmout((*found)->getAmount() - cargo->getAmount());
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(*found)->setAmout((*found)->getAmount() - cargo->getAmount());
(*found)->setAmount((*found)->getAmount() - cargo->getAmount());

McKucia added 2 commits July 3, 2020 17:19
Island.cpp + Readme.md + sell function fixed
@wbrejecki wbrejecki linked an issue Jul 4, 2020 that may be closed by this pull request
Comment on lines 5 to 16
enum class Response{
done, lack_of_money, lack_of_cargo, lack_of_space, no_cargo
};

class Store {
public:
Response buy(Cargo* cargo, Player* player);
Response sell(Cargo* cargo, Player* player);
private:
std::vector<std::shared_ptr<Cargo>> cargo_;
};

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Enum class Response should be inside of class Store

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2.1 Class Store

4 participants