diff options
author | Clyne Sullivan <tullivan99@gmail.com> | 2015-11-09 08:05:37 -0500 |
---|---|---|
committer | Clyne Sullivan <tullivan99@gmail.com> | 2015-11-09 08:05:37 -0500 |
commit | 9748d6306db7aa66128baeeca4c2a27b0efa1d87 (patch) | |
tree | 18b36403d0e622dce03a872cc21bb081e30dbecb /src/entities.cpp | |
parent | d54da1ea2b315a2ada023d189c31571949d25d06 (diff) |
worlds have indepentdent entity arrays
Diffstat (limited to 'src/entities.cpp')
-rw-r--r-- | src/entities.cpp | 12 |
1 files changed, 3 insertions, 9 deletions
diff --git a/src/entities.cpp b/src/entities.cpp index acc45bd..9a3730e 100644 --- a/src/entities.cpp +++ b/src/entities.cpp @@ -1,14 +1,11 @@ #include <entities.h> #include <ui.h> -std::vector<Entity *> entity; -std::vector<NPC *> npc; -std::vector<Structures *> build; -std::vector<Mob *> mob; - extern FILE* names; extern unsigned int loops; +extern World *currentWorld; + void Entity::spawn(float x, float y){ //spawns the entity you pass to it based off of coords and global entity settings loc.x = x; loc.y = y; @@ -317,10 +314,7 @@ unsigned int Structures::spawn(_TYPE t, float x, float y){ //spawns a structure * with type NPC by using polymorphism. */ - npc.push_back(new NPC()); - npc.back()->spawn(loc.x+(i-5),100); - - entity.push_back(npc.back()); + currentWorld->addNPC(loc.x+(i-5),100); } break; |