Castle Battle  1.0
castle.h
Go to the documentation of this file.
1 
2 #ifndef CASTLE_H
3 #define CASTLE_H
4 #include <irrlicht.h>
5 #include <vector>
6 #include <map>
7 #include "target.h"
8 #include "bullethelper.h"
9 #include "physics.h"
10 
11 
12 using namespace irr;
13 const f32 BLOCKS_OFFSET = 0.05f;
14 const f32 TARGET_OFFSET = 1.f;
16 class Castle{
17  private:
18  scene::ISceneManager* smgr;
19  video::IVideoDriver* driver;
20  core::vector3df position;
22  scene::IMeshSceneNode* node;
23  IrrlichtDevice* device;
25 
26  std::multimap<char, scene::IMeshSceneNode*> nodes;
30  core::vector3df initialTargetPos;
40  void createBlock(core::vector3df position, core::vector3df scale, core::vector3df rotation, char side, video::SColor color = randomColor());
42  void addToPhysicsWorld();
43 
44 
45  public:
46  video::SColor COLOR_LIGHT;
47  video::SColor COLOR_DARK;
57  Castle(scene::ISceneManager* smgr, Physics* physics, IrrlichtDevice* device, video::IVideoDriver* driver, core::vector3df center);
64  bool buildCastle(core::vector3df center);
74  core::vector3df getSideSize(char side);
76  void setTreasure();
78  core::vector3df calculateAbsoluteCenter();
84  bool checkTarget();
85 
86 };
87 #endif
Target represent the treasure of the castle.
Definition: target.h:7
video::SColor randomColor()
Get random color.
Definition: bullethelper.cpp:63
video::IVideoDriver * driver
Definition: castle.h:19
The Castle handles all things related to the Castles Building, treasure, physics and collisions...
Definition: castle.h:16
const f32 BLOCKS_OFFSET
Definition: castle.h:13
Physics class will handle all things related to collisions, creating Bullet physics objects and the p...
Definition: physics.h:12
video::SColor COLOR_DARK
Definition: castle.h:47
video::SColor COLOR_LIGHT
Definition: castle.h:46
core::vector3df initialTargetPos
Initial position of the first block.
Definition: castle.h:30
IrrlichtDevice * device
Definition: castle.h:23
std::multimap< char, scene::IMeshSceneNode * > nodes
Associative array for blocks.
Definition: castle.h:26
Physics * physics
Definition: castle.h:31
scene::ISceneManager * smgr
Definition: castle.h:18
const f32 TARGET_OFFSET
Definition: castle.h:14
scene::IMeshSceneNode * node
Last node used.
Definition: castle.h:22
core::vector3df position
Definition: castle.h:20
Target * target
Target node.
Definition: castle.h:28