From 45edad31559852d306d59b50f380cb79c9f27dcc Mon Sep 17 00:00:00 2001 From: Clyne Sullivan Date: Tue, 5 Jan 2016 08:48:29 -0500 Subject: save/load stuffs --- include/entities.h | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) (limited to 'include/entities.h') 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::vectoraiFunc; @@ -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{ -- cgit v1.2.3