From be85ca9d91ff867faf140328d0bcbb2062b58cdf Mon Sep 17 00:00:00 2001 From: Jared Adams <jaxad0127@gmail.com> Date: Thu, 13 Aug 2009 10:31:23 -0600 Subject: Make NPC inherit from Being instead of Player No need for NPCs to inherit from Player. Player has functions NPC doesn't need and overrides that NPC doesn't need. This change reduces the number of functions needed to be overrided by NPC. --- src/npc.cpp | 13 +------------ src/npc.h | 4 +--- 2 files changed, 2 insertions(+), 15 deletions(-) diff --git a/src/npc.cpp b/src/npc.cpp index a49ef406..f7172d4b 100644 --- a/src/npc.cpp +++ b/src/npc.cpp @@ -36,7 +36,7 @@ bool NPC::isTalking = false; int current_npc = 0; NPC::NPC(int id, int job, Map *map): - Player(id, job, map) + Being(id, job, map) { NPCInfo info = NPCDB::get(job); @@ -89,17 +89,6 @@ void NPC::setName(const std::string &name) Being::setName(displayName + " (NPC)"); } -void NPC::setGender(Gender gender) -{ - Being::setGender(gender); -} - -void NPC::setSprite(int slot, int id, std::string color) -{ - // Fix this later should it not be adequate enough. - Being::setSprite(slot, id, color); -} - Being::Type NPC::getType() const { return Being::NPC; diff --git a/src/npc.h b/src/npc.h index fc6f3459..392ee8c5 100644 --- a/src/npc.h +++ b/src/npc.h @@ -27,7 +27,7 @@ class Graphics; class Text; -class NPC : public Player +class NPC : public Being { public: NPC(int id, int job, Map *map); @@ -35,8 +35,6 @@ class NPC : public Player ~NPC(); void setName(const std::string &name); - void setGender(Gender gender); - void setSprite(int slot, int id, std::string color); virtual Type getType() const; -- cgit v1.2.3-70-g09d2