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 56 57 58 59 60 61 62 63 64 65 66 67 68
|
#ifndef _WORLD_H_
#define _WORLD_H_
#include <ClanLib/core.h>
#include <list>
class CL_Surface;
class CL_InputEvent;
class GameObject;
class TankVehicle;
class World
{
// Construction
public:
World();
~World();
// Attributes:
public:
CL_ResourceManager *resources;
// Operations:
public:
void initLevel();
bool hitCheck(CL_CollisionOutline *outline, GameObject *other);
void addObject(GameObject *object);
void addTank(TankVehicle *tank);
void run();
// Slots:
public:
void on_quit() { quit = true; }
// Implementation:
private:
void draw();
void update();
float calcTimeElapsed();
void onKeyDown(const CL_InputEvent &key);
void onMouseDown(const CL_InputEvent &key);
void onMouseUp(const CL_InputEvent &key);
void onMouseMove(const CL_InputEvent &key);
CL_Slot slotMouseDown;
CL_Slot slotMouseUp;
CL_Slot slotMouseMove;
CL_Slot slotKeyDown;
CL_Surface *background;
bool quit;
bool dragging;
bool mouseDown;
CL_Rect dragArea;
float highlightValue;
std::list<GameObject *> objects;
std::list<TankVehicle *> tanks;
};
#endif
|