From 0964a086ccfe2ba18b8e40d0199bdaf80841f344 Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Mon, 17 Oct 2016 19:22:07 -0400 Subject: indoorworld removal, substitutions made --- include/entities.hpp | 2 +- include/world.hpp | 60 +++++++++++----------------------------------------- 2 files changed, 13 insertions(+), 49 deletions(-) (limited to 'include') diff --git a/include/entities.hpp b/include/entities.hpp index 5f85c26..49598bd 100644 --- a/include/entities.hpp +++ b/include/entities.hpp @@ -339,7 +339,7 @@ class Structures : public Entity { public: BUILD_SUB bsubtype; World *inWorld; - IndoorWorld *insideWorld; + World *insideWorld; std::string inside; std::string textureLoc; 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, public entityx::Receiver { private: World *world; + World *outside; WorldWeather weather; @@ -149,7 +150,6 @@ private: std::string bgmObjFile; std::vector bgFiles; - std::vector 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. @@ -431,50 +439,6 @@ public: Village *addVillage(std::string name, World *world); }; -/** - * IndoorWorld - Indoor settings stored in a World class - */ -class IndoorWorld : public World { -private: - - // like lines, but split into floors - std::vector> floor; - - // the x coordinate to start each floor at - std::vector 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. * -- cgit v1.2.3