-
Notifications
You must be signed in to change notification settings - Fork 1
#2.1 Store.hpp & Store.cpp #30
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
base: homeworkOOP2
Are you sure you want to change the base?
Conversation
6. Class Map - function getIsland
malinaq3
left a comment
There was a problem hiding this 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> |
There was a problem hiding this comment.
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" | |||
There was a problem hiding this comment.
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 | |||
There was a problem hiding this comment.
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 { |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
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); | ||
| } |
There was a problem hiding this comment.
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()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| (*found)->setAmout((*found)->getAmount() - cargo->getAmount()); | |
| (*found)->setAmount((*found)->getAmount() - cargo->getAmount()); |
Island.cpp + Readme.md + sell function fixed
| 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_; | ||
| }; | ||
|
|
There was a problem hiding this comment.
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
No description provided.