/src/NPCManager.h

http://github.com/clintbellanger/flare · C Header · 58 lines · 27 code · 8 blank · 23 comment · 0 complexity · 6b235bd67fbd0fa3f272dbf5e18b8a73 MD5 · raw file

  1. /*
  2. Copyright 2011 Clint Bellanger
  3. This file is part of FLARE.
  4. FLARE is free software: you can redistribute it and/or modify it under the terms
  5. of the GNU General Public License as published by the Free Software Foundation,
  6. either version 3 of the License, or (at your option) any later version.
  7. FLARE is distributed in the hope that it will be useful, but WITHOUT ANY
  8. WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
  9. PARTICULAR PURPOSE. See the GNU General Public License for more details.
  10. You should have received a copy of the GNU General Public License along with
  11. FLARE. If not, see http://www.gnu.org/licenses/
  12. */
  13. /**
  14. * class NPCManager
  15. *
  16. * NPCs which are not combatative enemies are handled by this Manager.
  17. * Most commonly this involves vendor and conversation townspeople.
  18. */
  19. #ifndef NPC_MANAGER_H
  20. #define NPC_MANAGER_H
  21. #include "NPC.h"
  22. #include "MapIso.h"
  23. #include "WidgetTooltip.h"
  24. #include "LootManager.h"
  25. #include <SDL.h>
  26. // max number of NPCs for a single map
  27. const int MAX_NPC_COUNT = 32;
  28. class NPCManager {
  29. private:
  30. MapIso *map;
  31. WidgetTooltip *tip;
  32. LootManager *loot;
  33. ItemManager *items;
  34. TooltipData tip_buf;
  35. public:
  36. NPCManager(MapIso *_map, LootManager *_loot, ItemManager *_items);
  37. ~NPCManager();
  38. NPC *npcs[MAX_NPC_COUNT];
  39. void handleNewMap();
  40. void logic();
  41. int checkNPCClick(Point mouse, Point cam);
  42. void renderTooltips(Point cam, Point mouse);
  43. int npc_count;
  44. int tooltip_margin;
  45. };
  46. #endif