aboutsummaryrefslogtreecommitdiffstats
path: root/include/entities.h
diff options
context:
space:
mode:
authordrumsetmonkey <abelleisle@roadrunner.com>2016-01-07 08:33:54 -0500
committerdrumsetmonkey <abelleisle@roadrunner.com>2016-01-07 08:33:54 -0500
commite043a2432c4dacce56a308948188482fb230ff33 (patch)
treeb8809e54bc3c516dabfa8eace3b51a92d5c8fbcd /include/entities.h
parentc7e3d72f0ef08cb9463cd8960bc29dad40e3bdcb (diff)
parent45edad31559852d306d59b50f380cb79c9f27dcc (diff)
Hey, that's pretty good lighting!
Diffstat (limited to 'include/entities.h')
-rw-r--r--include/entities.h39
1 files changed, 38 insertions, 1 deletions
diff --git a/include/entities.h b/include/entities.h
index a4bc282..90af0f2 100644
--- a/include/entities.h
+++ b/include/entities.h
@@ -32,7 +32,8 @@ enum MOB_SUB {
MS_RABBIT = 1,
MS_BIRD,
MS_TRIGGER,
- MS_DOOR
+ MS_DOOR,
+ MS_PAGE
};
enum BUILD_SUB{
@@ -44,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 +165,9 @@ public:
virtual void interact(){}
virtual ~Entity(){}
+
+ char *baseSave(void);
+ void baseLoad(char *);
};
class Player : public Entity{
@@ -150,6 +179,11 @@ public:
~Player();
void interact();
};
+
+typedef struct {
+ EntitySavePacket esp;
+} __attribute__ ((packed)) NPCSavePacket;
+
class NPC : public Entity{
public:
std::vector<int (*)(NPC *)>aiFunc;
@@ -160,6 +194,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{