aboutsummaryrefslogtreecommitdiffstats
path: root/include/entities.h
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2016-01-07 08:35:51 -0500
committerClyne Sullivan <tullivan99@gmail.com>2016-01-07 08:35:51 -0500
commitcdd792bc8ba7337e7bd3a9d0b4141c63f17fb9a8 (patch)
treeab62d74ff7f7c1f03713c3b69568ad35c5c9b4d3 /include/entities.h
parent45edad31559852d306d59b50f380cb79c9f27dcc (diff)
world save/load done?
Diffstat (limited to 'include/entities.h')
-rw-r--r--include/entities.h42
1 files changed, 35 insertions, 7 deletions
diff --git a/include/entities.h b/include/entities.h
index 894dc16..0f7ac9b 100644
--- a/include/entities.h
+++ b/include/entities.h
@@ -66,7 +66,7 @@ typedef struct {
_TYPE type;
GENDER gender;
size_t nameSize;
- //char *name;
+ char name[32];
//Texturec *tex;
} __attribute__ ((packed)) EntitySavePacket;
@@ -179,10 +179,6 @@ public:
void interact();
};
-typedef struct {
- EntitySavePacket esp;
-} __attribute__ ((packed)) NPCSavePacket;
-
class NPC : public Entity{
public:
std::vector<int (*)(NPC *)>aiFunc;
@@ -195,9 +191,16 @@ public:
void wander(int);
char *save(unsigned int *size);
- void load(char *b);
+ void load(unsigned int,char *b);
};
+typedef struct {
+ EntitySavePacket esp;
+ World *inWorld;
+ World *inside;
+ BUILD_SUB bsubtype;
+} __attribute__ ((packed)) StructuresSavePacket;
+
class Structures : public Entity{
public:
World *inWorld;
@@ -208,6 +211,9 @@ public:
~Structures();
unsigned int spawn(_TYPE, BUILD_SUB, float, float, World *);
+
+ char *save(void);
+ void load(char *s);
};
class Mob : public Entity{
@@ -220,19 +226,41 @@ public:
~Mob();
void wander(int);
+
+ char *save(void);
+ void load(char *);
};
+typedef struct {
+ EntitySavePacket esp;
+ double init_y;
+ //void (*hey)(Mob *callee);
+} __attribute__ ((packed)) MobSavePacket;
+
+typedef struct {
+ EntitySavePacket esp;
+ ITEM_ID identifier;
+ bool questObject;
+ char pickupDialog[256];
+} __attribute__ ((packed)) ObjectSavePacket;
+
class Object : public Entity{
private:
- int identifier;
+ ITEM_ID identifier;
public:
char *pickupDialog;
bool questObject = false;
+ Object();
Object(ITEM_ID id, bool qo, const char *pd);
~Object();
+ void reloadTexture(void);
+
void interact(void);
+
+ char *save(void);
+ void load(char *);
};
#endif // ENTITIES_H