/src/GameStatePlay.h

http://github.com/clintbellanger/flare · C Header · 98 lines · 62 code · 14 blank · 22 comment · 0 complexity · 27ae4be48f6463bc314e133faf3ad80b 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 GameStatePlay
  15. *
  16. * Handles logic and rendering of the main action game play
  17. * Also handles message passing between child objects, often to avoid circular dependencies.
  18. */
  19. #ifndef GAMESTATEPLAY_H
  20. #define GAMESTATEPLAY_H
  21. #include "InputState.h"
  22. #include "Avatar.h"
  23. #include "Enemy.h"
  24. #include "MapIso.h"
  25. #include "Utils.h"
  26. #include "HazardManager.h"
  27. #include "EnemyManager.h"
  28. #include "FontEngine.h"
  29. #include "MenuManager.h"
  30. #include "LootManager.h"
  31. #include "PowerManager.h"
  32. #include "NPCManager.h"
  33. #include "CampaignManager.h"
  34. #include "QuestLog.h"
  35. #include "GameState.h"
  36. #include "WidgetLabel.h"
  37. #include <SDL.h>
  38. #include <SDL_image.h>
  39. class GameStatePlay : public GameState {
  40. private:
  41. MapIso *map;
  42. Enemy *enemy;
  43. Renderable r[1024];
  44. int renderableCount;
  45. HazardManager *hazards;
  46. EnemyManager *enemies;
  47. MenuManager *menu;
  48. LootManager *loot;
  49. PowerManager *powers;
  50. ItemManager *items;
  51. NPCManager *npcs;
  52. CampaignManager *camp;
  53. QuestLog *quests;
  54. WidgetLabel *label_mapname;
  55. WidgetLabel *label_fps;
  56. bool restrictPowerUse();
  57. void checkEnemyFocus();
  58. void checkLoot();
  59. void checkLootDrop();
  60. void checkTeleport();
  61. void checkCancel();
  62. void checkLog();
  63. void checkEquipmentChange();
  64. void checkConsumable();
  65. void checkNotifications();
  66. void checkNPCInteraction();
  67. int npc_id;
  68. public:
  69. GameStatePlay();
  70. ~GameStatePlay();
  71. void logic();
  72. void render();
  73. void showFPS(int fps);
  74. void saveGame();
  75. void loadGame();
  76. void resetGame();
  77. Avatar *pc;
  78. int game_slot;
  79. };
  80. #endif