From 8f5a73f1daba39c8b0175036cf688f8ce1399a8f Mon Sep 17 00:00:00 2001 From: majortom6 Date: Sun, 5 Mar 2017 13:13:44 -0600 Subject: -added carnivores -removed creature type constant and replaced it with herbavore/carnivore type -replaced resource type with plant type -added eatType to dna (whatever the organism goes for hunger) --- src/list.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'src/list.cpp') diff --git a/src/list.cpp b/src/list.cpp index d4b9529..9d32b21 100644 --- a/src/list.cpp +++ b/src/list.cpp @@ -3,15 +3,21 @@ List::List() { int i; - DNA d = DNA("creature"); + DNA d = DNA("herbavore"); Rectangle tmp; - for(i=0;i::iterator it = creatures.begin(); it!= creatures.end(); it++) if(it->getHealth()<=0){ - DNA d = DNA("resource"); + DNA d = DNA("plant"); Organism X(it->getRectangle(), d); resources.push_back(X); creatures.erase(it--); @@ -58,8 +64,8 @@ void List::Place() tree.clear(); Rectangle tmp; - DNA d = DNA("resource"); - while(resources.size() < MINIMUM_RESOURCES){ + DNA d = DNA("plant"); + while(resources.size() < MINIMUM_PLANTS){ Organism X(tmp, d); resources.push_back(X); } -- cgit v1.2.3