diff options
author | tom <tom@ground-control> | 2015-05-05 15:25:32 -0500 |
---|---|---|
committer | tom <tom@ground-control> | 2015-05-05 15:25:32 -0500 |
commit | 22cd24a1fe33b6bc9f52a600feb5cdb8d868d50f (patch) | |
tree | a2c854b5ed2b746017bd975a241f85b7080ffa4c /src/list.cpp | |
parent | afcf5f509a318ee66a16690f204f03dee701722e (diff) |
fixed list to make it easy to add more creatures/resources.
need to figure out how to generate more random numbers
after - implement resource amount and ability to eat
Diffstat (limited to 'src/list.cpp')
-rw-r--r-- | src/list.cpp | 28 |
1 files changed, 25 insertions, 3 deletions
diff --git a/src/list.cpp b/src/list.cpp index e1695d6..7d6f10e 100644 --- a/src/list.cpp +++ b/src/list.cpp @@ -2,6 +2,28 @@ List::List(Window m) { - C.insert(Creature(m,"img/Cbasic.png")); - R.insert(Resource(m,"img/Rbasic.png")); -}
\ No newline at end of file + Creature X0(m,"img/Cbasic.png"); + C.push_back(X0); + Creature X1(m,"img/Cbasic.png"); + C.push_back(X1); + + Resource Y(m,"img/Rbasic.png"); + R.push_back(Y); +}; + +void List::Behavior() +{ + int i; + for(i = 0; i < C.size(); i++) + C[i].Behavior(); +} + +void List::Place() +{ + int i; + for(i = 0; i < C.size(); i++) + C[i].Place(); + + for(i = 0; i < R.size(); i++) + R[i].Place(); +} |