PageRenderTime 29ms CodeModel.GetById 14ms app.highlight 10ms RepoModel.GetById 1ms app.codeStats 0ms

/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/*
 2Copyright 2011 Clint Bellanger
 3
 4This file is part of FLARE.
 5
 6FLARE is free software: you can redistribute it and/or modify it under the terms
 7of the GNU General Public License as published by the Free Software Foundation,
 8either version 3 of the License, or (at your option) any later version.
 9
10FLARE is distributed in the hope that it will be useful, but WITHOUT ANY
11WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
12PARTICULAR PURPOSE.  See the GNU General Public License for more details.
13
14You should have received a copy of the GNU General Public License along with
15FLARE.  If not, see http://www.gnu.org/licenses/
16*/
17
18/**
19 * class GameStatePlay
20 *
21 * Handles logic and rendering of the main action game play
22 * Also handles message passing between child objects, often to avoid circular dependencies.
23 */
24
25#ifndef GAMESTATEPLAY_H
26#define GAMESTATEPLAY_H
27
28#include "InputState.h"
29#include "Avatar.h"
30#include "Enemy.h"
31#include "MapIso.h"
32#include "Utils.h"
33#include "HazardManager.h"
34#include "EnemyManager.h"
35#include "FontEngine.h"
36#include "MenuManager.h"
37#include "LootManager.h"
38#include "PowerManager.h"
39#include "NPCManager.h"
40#include "CampaignManager.h"
41#include "QuestLog.h"
42#include "GameState.h"
43#include "WidgetLabel.h"
44
45#include <SDL.h>
46#include <SDL_image.h>
47
48class GameStatePlay : public GameState {
49private:
50
51	MapIso *map;
52	Enemy *enemy;
53	Renderable r[1024];
54	int renderableCount;
55	HazardManager *hazards;
56	EnemyManager *enemies;
57	MenuManager *menu;
58	LootManager *loot;
59	PowerManager *powers;
60	ItemManager *items;
61	NPCManager *npcs;
62	CampaignManager *camp;
63	QuestLog *quests;
64
65	WidgetLabel *label_mapname;
66	WidgetLabel *label_fps;
67	
68	bool restrictPowerUse();
69	void checkEnemyFocus();
70	void checkLoot();
71	void checkLootDrop();
72	void checkTeleport();
73	void checkCancel();
74	void checkLog();
75	void checkEquipmentChange();
76	void checkConsumable();
77	void checkNotifications();
78	void checkNPCInteraction();
79
80	int npc_id;
81	
82public:
83	GameStatePlay();
84	~GameStatePlay();
85
86	void logic();
87	void render();
88	void showFPS(int fps);
89	void saveGame();
90	void loadGame();
91	void resetGame();
92
93	Avatar *pc;
94	int game_slot;
95};
96
97#endif
98