diff options
Diffstat (limited to 'src/being.cpp')
-rw-r--r-- | src/being.cpp | 37 |
1 files changed, 33 insertions, 4 deletions
diff --git a/src/being.cpp b/src/being.cpp index 1b2e595c..03649dc6 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -73,7 +73,7 @@ void remove_node(unsigned int id) { } } -unsigned int find_npc(unsigned short x, unsigned short y) { +unsigned int findNpc(unsigned short x, unsigned short y) { std::list<Being *>::iterator i; for (i = beings.begin(); i != beings.end(); i++) { Being *being = (*i); @@ -87,7 +87,7 @@ unsigned int find_npc(unsigned short x, unsigned short y) { return 0; } -unsigned int find_pc(unsigned short x, unsigned short y) { +unsigned int findPlayer(unsigned short x, unsigned short y) { std::list<Being *>::iterator i; for (i = beings.begin(); i != beings.end(); i++) { Being *being = (*i); @@ -99,7 +99,7 @@ unsigned int find_pc(unsigned short x, unsigned short y) { return 0; } -unsigned int find_monster(unsigned short x, unsigned short y) { +unsigned int findMonster(unsigned short x, unsigned short y) { std::list<Being*>::iterator i; for (i = beings.begin(); i != beings.end(); i++) { Being *being = (*i); @@ -114,7 +114,7 @@ unsigned int find_monster(unsigned short x, unsigned short y) { return 0; } -Being *find_node(unsigned int id) { +Being *findNode(unsigned int id) { std::list<Being*>::iterator i; for (i = beings.begin(); i != beings.end(); i++) { Being *being = (*i); @@ -125,6 +125,17 @@ Being *find_node(unsigned int id) { return NULL; } +Being *findNode(unsigned short x, unsigned short y) { + std::list<Being*>::iterator i; + for (i = beings.begin(); i != beings.end(); i++) { + Being *being = (*i); + if (being->x == x && being->y == y) { + return being; + } + } + return NULL; +} + class BeingCompare { public: bool operator() (const Being *a, const Being *b) const { @@ -281,3 +292,21 @@ void Being::drawSpeech(Graphics *graphics) gcn::Graphics::CENTER); } } + +bool Being::isPlayer() { + if (job < 10) + return true; + return false; +} + +bool Being::isNpc() { + if (job > 45 && job <126) + return true; + return false; +} + +bool Being::isMonster() { + if (job > 200) + return true; + return false; +} |