-
Notifications
You must be signed in to change notification settings - Fork 0
/
GameState.h
55 lines (43 loc) · 1.19 KB
/
GameState.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
/*
* Licensed under GNU GPL v2
* Author(s): Christofer Oden
* Created on: 091030
*/
#ifndef GAME_STATE_H
#define GAME_STATE_H
#include "State.h"
#include "Interface.h"
#include "Camera.h"
#include "World.h"
#include "PlayerManager.h"
#include <SDL/SDL.h>
class GameState : public State {
public:
void initialize( SDL_Surface *screen );
void handle_events();
void update();
void draw();
void handle_keyboard_event( SDL_Event *event );
void handle_mouse_event( SDL_Event *event );
void draw_tiles();
void draw_static_entities();
void draw_mobile_entities();
void draw_interface();
void draw_health_bar( SDL_Rect *box, int health, int max_health );
void draw_unit_sprite( int x, int y, UnitType unit_type,
int player_id );
void draw_water_sprites( int row, int col );
void draw_tree_sprites( int row, int col );
bool get_is_running() { return i_am_running; }
void set_is_running( bool is_running ) { i_am_running = is_running; }
private:
SDL_Surface *the_screen;
Camera my_camera;
World my_world;
PlayerManager my_player_manager;
Interface my_interface;
SDL_Surface *my_sprite_map;
SDL_Surface *my_font_map;
bool i_am_running;
};
#endif