summaryrefslogtreecommitdiff
path: root/src/list.cpp
diff options
context:
space:
mode:
authormajortom6 <tombarrett@siu.edu>2017-02-19 08:06:37 -0600
committerTom Barrett <tombarrett@siu.edu>2017-03-07 13:23:41 -0600
commit2cc21176467d4501adb7bfb9ee03eb9a2a7d14f2 (patch)
treee12ceac7024bdc697f1ed4adc1a1ece4a82489fc /src/list.cpp
parent74c6854fd8dcbaee736ac0421805ff1e03c4a1e2 (diff)
-removed all references to sdl_rect and location and now everything now uses our own class rectangle
-standardization of tab spaces to 8 is now in effect -refractoring of graphicsobjects.hpp
Diffstat (limited to 'src/list.cpp')
-rw-r--r--src/list.cpp15
1 files changed, 7 insertions, 8 deletions
diff --git a/src/list.cpp b/src/list.cpp
index fab5813..e83822f 100644
--- a/src/list.cpp
+++ b/src/list.cpp
@@ -3,9 +3,8 @@
List::List()
{
int i;
- Dna defaultDNA;
- //SDL_Rect rect = {0,0,defaultDNA.sizeMax/5,defaultDNA.sizeMax/5};
- Location tmp;
+ DNA defaultDNA;
+ Rectangle tmp;
tmp.x = tmp.y = 0;
for(i=0;i<CREATURES;i++){
Creature X(tmp,defaultDNA);
@@ -26,7 +25,7 @@ void List::Remove()
{
for(std::list<Creature>::iterator it = C.begin(); it!=C.end(); it++)
if(it->getHealth()<=0){
- Location tmp = it->getLocation();
+ Rectangle tmp = it->getRectangle();
Resource r = Resource(tmp);
R.push_back(r);
C.erase(it--);
@@ -41,12 +40,12 @@ void List::Behavior()
{
for(std::list<Creature>::iterator it = C.begin(); it!=C.end(); it++){
std::list<Entity*> N = getNear(*it);
- it->giveN(N);
+ it->giveNearMe(N);
it->Behavior();
if(it->getPregnancyReady()){
- Dna D = it->getChildDNA();
- Location tmp = it->getLocation();
+ DNA D = it->getChildsDNA();
+ Rectangle tmp = it->getRectangle();
Creature X(tmp,D);
C.push_back(X);
it->hadPregnancy();
@@ -61,7 +60,7 @@ void List::Place()
{
tree.clear();
- Location tmp;
+ Rectangle tmp;
tmp.x = tmp.y = 0;
while(R.size() < MINIMUM_RESOURCES){
Resource Y(tmp);