diff options
author | drumsetmonkey <abelleisle@roadrunner.com> | 2015-09-30 08:50:49 -0400 |
---|---|---|
committer | drumsetmonkey <abelleisle@roadrunner.com> | 2015-09-30 08:50:49 -0400 |
commit | cfa79da357843f7918ff7108bce80acb59df3413 (patch) | |
tree | 5c287ad36ca30519715fe15cd6f3642ee42c6c45 /src/entities.cpp | |
parent | a9f617e28ed109786cbdf9457878a2837d292a9a (diff) | |
parent | b3e21d31304efd793c58e904765bf298da6c5c20 (diff) |
Started names and genders
Diffstat (limited to 'src/entities.cpp')
-rw-r--r-- | src/entities.cpp | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/entities.cpp b/src/entities.cpp index 14048a0..9fe05c7 100644 --- a/src/entities.cpp +++ b/src/entities.cpp @@ -66,8 +66,19 @@ NPC::NPC(){ //sets all of the NPC specific traits on object creation canMove = true; } +void NPC::addAIFunc(int (*func)(NPC *)){ + aiFunc.push_back(func); +} + void NPC::interact(){ //have the npc's interact back to the player + int (*func)(NPC *); loc.y += 5; + if(aiFunc.size()){ + func=aiFunc.front(); + if(!func(this)){ + aiFunc.erase(aiFunc.begin()); + } + } } Structures::Structures(){ //sets the structure type |