aboutsummaryrefslogtreecommitdiffstats
path: root/include/world.hpp
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2016-05-31 08:49:48 -0400
committerClyne Sullivan <tullivan99@gmail.com>2016-05-31 08:49:48 -0400
commitb22860234ff7991c851211042a9832d88ccbb958 (patch)
tree255f72ca00a3567c69b7f8f0bc7889aa3b12689d /include/world.hpp
parent7dd64863c9ca613cf6969442f621849762b20115 (diff)
entitys can modify xml
Diffstat (limited to 'include/world.hpp')
-rw-r--r--include/world.hpp20
1 files changed, 17 insertions, 3 deletions
diff --git a/include/world.hpp b/include/world.hpp
index ce50244..f6a432d 100644
--- a/include/world.hpp
+++ b/include/world.hpp
@@ -15,7 +15,7 @@
* This enum contains all different possibilities for world backgrounds; used
* in World::setBackground() to select the appropriate images.
*/
-enum class WorldBGType : unsigned char {
+enum class WorldBGType : unsigned int {
Forest, /**< A forest theme. */
WoodHouse /**< An indoor wooden house theme. */
};
@@ -465,14 +465,14 @@ public:
void addMob(Mob *m, vec2 coord);
- void addNPC(float x, float y);
+ void addNPC(NPC *n);
void addObject(std::string in, std::string pickupDialog, float x, float y);
void addParticle(float x, float y, float w, float h, float vx, float vy, Color color, int dur);
void addParticle(float x, float y, float w, float h, float vx, float vy, Color color, int dur, unsigned char flags);
- void addStructure(BUILD_SUB subtype, float x, float y, std::string tex, std::string inside);
+ void addStructure(Structures *s);
Village *addVillage(std::string name, World *world);
};
@@ -549,6 +549,12 @@ public:
};
/**
+ * Constructs an XML object for accessing/modifying the current world's XML
+ * file.
+ */
+const XMLDocument& loadWorldXML(void);
+
+/**
* Loads the player into the world created by the given XML file. If a world is
* already loaded it will be saved before the transition is made.
*/
@@ -560,8 +566,16 @@ World *loadWorldFromXML(std::string path);
*/
World *loadWorldFromXMLNoSave(std::string path);
+/**
+ * Loads a world using a pointer to the current world (used for loading adjacent
+ * worlds that have already been read into memory.
+ */
World *loadWorldFromPtr(World *ptr);
+/**
+ * Casts a normal world to an indoor world, to access IndoorWorld-exclusive
+ * elements.
+ */
constexpr IndoorWorld *Indoorp(World *w)
{
return (IndoorWorld *)w;