diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/list.cpp | 16 |
1 files changed, 10 insertions, 6 deletions
diff --git a/src/list.cpp b/src/list.cpp index b8d2888..3127d76 100644 --- a/src/list.cpp +++ b/src/list.cpp @@ -2,23 +2,21 @@ List::List(Window m) { - int i; + main = m; + int i; SDL_Rect Rect = {0,0,CREATURE_SIZE,CREATURE_SIZE}; - for(i=0;i<CREATURES;i++){ - Creature X(m,Rect); + Creature X(main,Rect); C.push_back(X); } Rect = {0,0,RESOURCE_SIZE,RESOURCE_SIZE}; - for(i=0;i<RESOURCES;i++){ - Resource Y(m,Rect); + Resource Y(main,Rect); R.push_back(Y); } - main = m; } void List::Place() @@ -50,6 +48,12 @@ void List::Behavior() C.erase(it--); } } + + SDL_Rect Rect = {0,0,RESOURCE_SIZE,RESOURCE_SIZE}; + while(R.size() < MINIMUM_RESOURCES){ + Resource Y(main,Rect); + R.push_back(Y); + } } list<Entity*> List::getNear(Creature nC) |