aboutsummaryrefslogtreecommitdiffstats
path: root/include/world.hpp
diff options
context:
space:
mode:
Diffstat (limited to 'include/world.hpp')
-rw-r--r--include/world.hpp60
1 files changed, 12 insertions, 48 deletions
diff --git a/include/world.hpp b/include/world.hpp
index a574401..4b25e85 100644
--- a/include/world.hpp
+++ b/include/world.hpp
@@ -17,7 +17,7 @@
* in World::setBackground() to select the appropriate images.
*/
enum class WorldBGType : unsigned int {
- Forest, /**< A forest theme. */
+ Forest = 0, /**< A forest theme. */
WoodHouse /**< An indoor wooden house theme. */
};
@@ -142,6 +142,7 @@ constexpr const char* WorldWeatherString[3] = {
class WorldSystem : public entityx::System<WorldSystem>, public entityx::Receiver<WorldSystem> {
private:
World *world;
+ World *outside;
WorldWeather weather;
@@ -149,7 +150,6 @@ private:
std::string bgmObjFile;
std::vector<std::string> bgFiles;
- std::vector<std::string> bgFilesIndoors;
TextureIterator bgTex;
@@ -180,6 +180,9 @@ public:
void detect(entityx::TimeDelta dt);
void detect2(entityx::TimeDelta dt);
+
+ void enterWorld(World *w);
+ void leaveWorld(void);
};
@@ -190,9 +193,14 @@ public:
* drawing.
*/
class World {
-//friend class ItemLight;
+private:
+ bool m_Indoor;
+
public:
+ inline bool isIndoor(void) const
+ { return m_Indoor; }
+
WorldBGType bgType;
std::string styleFolder;
@@ -285,7 +293,7 @@ public:
/**
* Constructs the world, resets variables.
*/
- World(void);
+ World(bool indoor = false);
/**
* Destructs the world, frees memory.
@@ -432,50 +440,6 @@ public:
};
/**
- * IndoorWorld - Indoor settings stored in a World class
- */
-class IndoorWorld : public World {
-private:
-
- // like lines, but split into floors
- std::vector<std::vector<float>> floor;
-
- // the x coordinate to start each floor at
- std::vector<float> fstart;
-
- // handles physics for a single entity
- void singleDetect(Entity *e);
-
-public:
-
- World *outside;
-
- // creates an IndoorWorld object
- IndoorWorld(void);
-
- // frees memory used by this object
- ~IndoorWorld(void);
-
- // adds a floor of the desired width
- void addFloor(unsigned int width);
-
- // adds a floor at the desired x coordinate with the given width
- void addFloor(unsigned int width, unsigned int start);
-
- // attempts to move the entity provided to the given floor
- bool moveToFloor(Entity *e, unsigned int _floor);
-
- // checks for a floor above the given entity
- bool isFloorAbove(Entity *e);
-
- // checks for a floor below the given entity
- bool isFloorBelow(Entity *e);
-
- // draws the world about the player
- void draw(Player *p);
-};
-
-/**
* The arena class - creates an arena.
*
* This world, when created, expects a pointer to a Mob. This mob will be