aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/entities.hpp4
-rw-r--r--include/mob.hpp11
-rw-r--r--include/ui.hpp2
-rw-r--r--include/ui_menu.hpp11
-rw-r--r--include/world.hpp2
5 files changed, 23 insertions, 7 deletions
diff --git a/include/entities.hpp b/include/entities.hpp
index 76b6fa8..4abb3cb 100644
--- a/include/entities.hpp
+++ b/include/entities.hpp
@@ -107,6 +107,7 @@ extern const unsigned int NPC_INV_SIZE;
// a prototype of the world class, necessary for some function prototypes
class World;
+class IndoorWorld;
/**
* The light structure, used to store light coordinates and color.
@@ -325,7 +326,8 @@ public:
class Structures : public Entity {
public:
BUILD_SUB bsubtype;
- World *inWorld, *insideWorld;
+ World *inWorld;
+ IndoorWorld *insideWorld;
std::string inside;
std::string textureLoc;
diff --git a/include/mob.hpp b/include/mob.hpp
index 7ef4ff9..24b8ed9 100644
--- a/include/mob.hpp
+++ b/include/mob.hpp
@@ -126,4 +126,15 @@ public:
void saveToXML(void) final;
};
+class Chest : public Mob {
+public:
+ Chest(void);
+
+ void act(void);
+ void onHit(unsigned int);
+ bool bindTex(void);
+ void createFromXML(XMLElement *e, World *w) final;
+ void saveToXML(void) final;
+};
+
#endif // MOB_H_
diff --git a/include/ui.hpp b/include/ui.hpp
index 507a211..25fbd3c 100644
--- a/include/ui.hpp
+++ b/include/ui.hpp
@@ -40,6 +40,8 @@
** The UI namespace
** --------------------------------------------------------------------------*/
+void setControl(unsigned int index, SDL_Keycode key);
+
namespace ui {
// the pixel-coordinates of the mouse
diff --git a/include/ui_menu.hpp b/include/ui_menu.hpp
index f7b665e..3ed9fa5 100644
--- a/include/ui_menu.hpp
+++ b/include/ui_menu.hpp
@@ -7,9 +7,12 @@
typedef void (*menuFunc)(void);
+class Menu;
+
class menuItem {
public:
int member;
+ Menu *child;
union {
struct {
vec2 loc;
@@ -46,25 +49,21 @@ public:
class Menu {
public:
std::vector<menuItem> items;
- Menu *parent, *child;
+ Menu *parent;
~Menu()
{
items.clear();
- //delete child;
- //delete parent;
- child = NULL;
parent = NULL;
}
- void gotoChild(void);
void gotoParent(void);
};
namespace ui {
namespace menu {
menuItem createButton(vec2 l, dim2 d, Color c, const char* t, menuFunc f);
- menuItem createChildButton(vec2 l, dim2 d, Color c, const char* t);
+ menuItem createChildButton(vec2 l, dim2 d, Color c, const char* ti, Menu *_child);
menuItem createParentButton(vec2 l, dim2 d, Color c, const char* t);
menuItem createSlider(vec2 l, dim2 d, Color c, float min, float max, const char* t, float* v);
diff --git a/include/world.hpp b/include/world.hpp
index 6a97daa..a2de048 100644
--- a/include/world.hpp
+++ b/include/world.hpp
@@ -495,6 +495,8 @@ private:
public:
+ World *outside;
+
// creates an IndoorWorld object
IndoorWorld(void);