From aaf0a73578ecbb8212e0d224d6fff68a229b1f48 Mon Sep 17 00:00:00 2001 From: tom Date: Tue, 5 May 2015 21:01:52 -0500 Subject: fleshed out list, locations of all creatures and resources are now within --- src/list.cpp | 27 ++++++++++++++++++++------- 1 file changed, 20 insertions(+), 7 deletions(-) (limited to 'src/list.cpp') diff --git a/src/list.cpp b/src/list.cpp index 7d6f10e..b8a809c 100644 --- a/src/list.cpp +++ b/src/list.cpp @@ -2,28 +2,41 @@ List::List(Window m) { - Creature X0(m,"img/Cbasic.png"); - C.push_back(X0); - Creature X1(m,"img/Cbasic.png"); - C.push_back(X1); + int i; + for(i=0;i<5;i++) + { + Creature X = Creature(m,"img/Cbasic.png"); + C.push_back(X); + } - Resource Y(m,"img/Rbasic.png"); - R.push_back(Y); -}; + for(i=0;i<5;i++) + { + Resource Y(m,"img/Rbasic.png"); + R.push_back(Y); + L.push_back(Y.getLocation()); + } +} 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(); + L.push_back(C[i].getLocation()); + } for(i = 0; i < R.size(); i++) + { R[i].Place(); + } } -- cgit v1.2.3