summaryrefslogtreecommitdiff
path: root/inc
diff options
context:
space:
mode:
authormajortom6 <tombarrett@siu.edu>2017-02-26 07:39:15 -0600
committerTom Barrett <tombarrett@siu.edu>2017-03-07 13:23:42 -0600
commit2e4d19ba21347cc370d1aae7a57298328b94ca4e (patch)
tree715f970ec2aa97eeb42a1144a3361df15b599df7 /inc
parent72b40aec2addc7b28170ba9364bc0429149b3299 (diff)
-comepletly removed use of lists in quadtree and creature, using vectors now
Diffstat (limited to 'inc')
-rw-r--r--inc/creature.hpp4
-rw-r--r--inc/list.hpp3
-rw-r--r--inc/quadtree.hpp5
3 files changed, 5 insertions, 7 deletions
diff --git a/inc/creature.hpp b/inc/creature.hpp
index f9cb979..8174cf6 100644
--- a/inc/creature.hpp
+++ b/inc/creature.hpp
@@ -1,9 +1,7 @@
#ifndef creature_h
#define creature_h
-#include <cstdlib>
#include <vector>
-#include <list>
#include <algorithm>
#include "entity.hpp"
@@ -21,7 +19,7 @@ class Creature: public Entity
void checkTarget();
void moveTowards(Rectangle r);
void impregnate(DNA d);
- void giveNearMe(std::list<Entity*> n){nearMe = {std::begin(n),std::end(n)};};
+ void giveNearMe(std::vector<Entity*> n){nearMe = n;};
DNA getDNA(){return myDNA;};
DNA getChildsDNA(){return childsDNA;};
diff --git a/inc/list.hpp b/inc/list.hpp
index 872d5fa..f62112c 100644
--- a/inc/list.hpp
+++ b/inc/list.hpp
@@ -17,7 +17,8 @@ class List
void Place();
void Remove();
- std::list<Entity*> getNear(Creature c);
+ std::vector<Entity*> getNear(Creature c);
+
std::list<Resource> resources;
std::list<Creature> creatures;
diff --git a/inc/quadtree.hpp b/inc/quadtree.hpp
index 2b07103..bf308f8 100644
--- a/inc/quadtree.hpp
+++ b/inc/quadtree.hpp
@@ -1,7 +1,6 @@
#ifndef quadtree_h
#define quadtree_h
-#include <list>
#include <vector>
#include "constants.hpp"
@@ -21,8 +20,8 @@ class Quadtree {
void clear();
void insert(Entity* iter);
- std::list<Entity*> retrieve(std::list<Entity*> returnObject, GraphicsData obj);
- std::list<Entity*> objects;
+ std::vector<Entity*> retrieve(std::vector<Entity*> returnObject, GraphicsData obj);
+ std::vector<Entity*> objects;
Quadtree* nodes;