projects
/
TDDC76_proj.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
7b17a34
)
Added removal of bottles, arvid, stina
author
Arvid Sjöblom
<arvsj277@student.liu.se>
Mon, 13 Nov 2023 10:26:18 +0000
(11:26 +0100)
committer
Arvid Sjöblom
<arvsj277@student.liu.se>
Mon, 13 Nov 2023 10:26:18 +0000
(11:26 +0100)
src/States.cc
patch
|
blob
|
history
diff --git
a/src/States.cc
b/src/States.cc
index 659d4b79412702ad2fa9aae4f57712069d64e4e5..217c45913793adaf25f13db14e82f1074e990f3e 100644
(file)
--- a/
src/States.cc
+++ b/
src/States.cc
@@
-25,6
+25,10
@@
void Game_state::update(Context& context)
std::cout << std::fixed << std::setprecision(3) << time_since_last_bottle << std::endl;
if (time_since_last_bottle >= 2)
{
+ if (bottles.size() > 10)
+ {
+ bottles.erase(bottles.begin());
+ }
Bottle* bottle = new Bottle {};
bottles.push_back(bottle);
std::cout << "placed bottle"<< std::endl;