aboutsummaryrefslogtreecommitdiffstats
path: root/include/entities.h
diff options
context:
space:
mode:
authorClyne Sullivan <tullivan99@gmail.com>2016-01-05 08:48:29 -0500
committerClyne Sullivan <tullivan99@gmail.com>2016-01-05 08:48:29 -0500
commit45edad31559852d306d59b50f380cb79c9f27dcc (patch)
tree2a8b7ac460bfae33f517f3b24904be7158ab0d7a /include/entities.h
parent65addfa212a2aef2f2d6de3cb49edc99a8f02f59 (diff)
save/load stuffs
Diffstat (limited to 'include/entities.h')
-rw-r--r--include/entities.h35
1 files changed, 35 insertions, 0 deletions
diff --git a/include/entities.h b/include/entities.h
index 6b8cc32..894dc16 100644
--- a/include/entities.h
+++ b/include/entities.h
@@ -45,6 +45,31 @@ enum BUILD_SUB{
FOUNTAIN
};
+typedef struct {
+ InventorySavePacket isp;
+ vec2 loc;
+ vec2 vel;
+ float width;
+ float height;
+ float speed;
+ float health;
+ float maxHealth;
+ int subtype;
+ int ticksToUse;
+ unsigned int randDialog;
+ unsigned char ground;
+ bool near;
+ bool canMove;
+ bool right,left;
+ bool alive;
+ bool hit;
+ _TYPE type;
+ GENDER gender;
+ size_t nameSize;
+ //char *name;
+ //Texturec *tex;
+} __attribute__ ((packed)) EntitySavePacket;
+
class World;
class Particles{
@@ -139,6 +164,9 @@ public:
virtual void interact(){}
virtual ~Entity(){}
+
+ char *baseSave(void);
+ void baseLoad(char *);
};
class Player : public Entity {
@@ -151,6 +179,10 @@ public:
void interact();
};
+typedef struct {
+ EntitySavePacket esp;
+} __attribute__ ((packed)) NPCSavePacket;
+
class NPC : public Entity{
public:
std::vector<int (*)(NPC *)>aiFunc;
@@ -161,6 +193,9 @@ public:
void addAIFunc(int (*func)(NPC *),bool preload);
void interact();
void wander(int);
+
+ char *save(unsigned int *size);
+ void load(char *b);
};
class Structures : public Entity{