aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2016-03-03 15:45:10 -0500
committerClyne Sullivan <tullivan99@gmail.com>2016-03-03 15:45:10 -0500
commitfe5ea7fe415857f49d6630f2b0f50e1246c38eee (patch)
tree8a14040bb753143bdd583f813578df4c83191557 /include
parent90f3d2ff9fe7297dae0bdcee9c441e53177a0fb7 (diff)
c++'d more stuff
Diffstat (limited to 'include')
-rw-r--r--include/entities.h4
-rw-r--r--include/world.h89
2 files changed, 21 insertions, 72 deletions
diff --git a/include/entities.h b/include/entities.h
index 3b8a19b..334bfeb 100644
--- a/include/entities.h
+++ b/include/entities.h
@@ -254,11 +254,11 @@ class Object : public Entity{
private:
std::string iname;
public:
- char *pickupDialog;
+ std::string pickupDialog;
bool questObject = false;
Object();
- Object(std::string in,const char *pd);
+ Object(std::string in,std::string pd);
~Object();
void reloadTexture(void);
diff --git a/include/world.h b/include/world.h
index 7b9383a..825d83d 100644
--- a/include/world.h
+++ b/include/world.h
@@ -29,10 +29,10 @@
* in World::setBackground() to select the appropriate images.
*/
-typedef enum {
- BG_FOREST, /**< A forest theme. */
- BG_WOODHOUSE, /**< An indoor wooden house theme. */
-} WORLD_BG_TYPE;
+enum class WorldBGType : unsigned char {
+ Forest, /**< A forest theme. */
+ WoodHouse /**< An indoor wooden house theme. */
+};
/**
* The weather type enum.
@@ -40,11 +40,11 @@ typedef enum {
* Weather is set by the world somewhere.
*/
-typedef enum {
- SUNNY = 0, /**< Sunny/daytime */
- DARK, /**< Nighttime */
- RAIN /**< Rain (to be implemented)*/
-} WEATHER;
+enum class WorldWeather : unsigned char {
+ Sunny = 0, /**< Sunny/daytime */
+ Dark, /**< Nighttime */
+ Rain /**< Rain (to be implemented)*/
+};
/**
* The light structure, used to store light coordinates and color.
@@ -76,56 +76,16 @@ class World;
class Village {
public:
-
- /**
- * The name of the village.
- */
-
std::string name;
-
- /**
- * The coordinate of where the village starts.
- *
- * This is used to check if the player has entered the village's area.
- */
-
vec2 start;
-
- /**
- * The coordinate of where the village ends.
- *
- * This is used to check if the player has entered the village's area.
- */
-
vec2 end;
-
- /**
- * TODO
- */
-
bool in;
-
- /**
- * A vector of all structures that are associated with this village.
- */
-
std::vector<Structures *> build;
- /**
- * Creates a village of name `meme` in the world `w`.
- */
-
Village(const char *meme, World *w);
-
- /**
- * Destructor...
- */
-
~Village(void){}
};
-extern Player *player;
-
/**
* The world class. This class does everything a world should do.
*/
@@ -194,7 +154,7 @@ protected:
* Defines the set of background images that should be used for this world.
*/
- WORLD_BG_TYPE bgType;
+ WorldBGType bgType;
/**
* The Mix_Music object that holds the background soundtrack for the world.
@@ -206,7 +166,8 @@ protected:
* The file path of the song wished to be loaded by bgmObj.
*/
- char *bgm;
+ std::string bgm;
+
std::vector<std::string>bgFiles;
std::vector<std::string>bgFilesIndoors;
@@ -238,11 +199,6 @@ public:
char *setToRight(const char *file);
- void callUpdate(){
- this->update(player,deltaTime);
- }
-
-
/**
* A vector of pointers to every NPC, Structure, Mob, and Object in this
* world.
@@ -345,7 +301,7 @@ public:
* upon object interaction.
*/
- void addObject(std::string in, const char *pickupDialog, float x, float y);
+ void addObject( std::string in, std::string pickupDialog, float x, float y);
/**
* Adds a particle to the world with the specified coordinates, dimensions,
@@ -359,13 +315,6 @@ public:
*/
void addLight(vec2 xy, Color color);
-
- /**
- * Get the next NPC in the NPC vector that currently lacks a written dialog.
- * Could be used to assign random NPCs non-random dialogs.
- */
-
- NPC *getAvailableNPC(void);
/**
* Updates the coordinates of everything in the world that has coordinates
@@ -387,7 +336,7 @@ public:
* Texturec object.
*/
- void setBackground(WORLD_BG_TYPE bgt);
+ void setBackground(WorldBGType bgt);
/**
* Sets the background music for the world, required for the world to be
@@ -400,14 +349,14 @@ public:
* Sets the worlds style folder
*/
- void setStyle(const char* pre);
+ void setStyle(std::string pre);
/**
* Plays/stops this world's BGM. If `prev` is not NULL, that world's BGM
* will be faded out followed by the fading in of this world's BGM.
*/
- void bgmPlay(World *prev);
+ void bgmPlay(World *prev) const;
/**
* Draw the world and entities based on the player's coordinates.
@@ -457,7 +406,7 @@ public:
* Get's the world's width.
*/
- int getTheWidth(void);
+ int getTheWidth(void) const;
void save(void);
void load(void);
@@ -488,7 +437,7 @@ public:
extern int worldShade;
extern std::string currentXML;
-World *loadWorldFromXML(const char *path);
-World *loadWorldFromXMLNoSave(const char *path);
+World *loadWorldFromXML(std::string path);
+World *loadWorldFromXMLNoSave(std::string path);
#endif // WORLD_H