aboutsummaryrefslogtreecommitdiffstats
path: root/include/inventory.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/inventory.h
parent65addfa212a2aef2f2d6de3cb49edc99a8f02f59 (diff)
save/load stuffs
Diffstat (limited to 'include/inventory.h')
-rw-r--r--include/inventory.h17
1 files changed, 17 insertions, 0 deletions
diff --git a/include/inventory.h b/include/inventory.h
index 31b7d88..b035f91 100644
--- a/include/inventory.h
+++ b/include/inventory.h
@@ -60,6 +60,11 @@ struct item_t{
ITEM_ID id;
} __attribute__((packed));
+typedef struct {
+ unsigned int size;
+ int os;
+ unsigned int sel;
+} __attribute__ ((packed)) InventorySavePacket;
class Inventory {
private:
@@ -87,6 +92,18 @@ public:
void draw(void); // Draws a text list of items in this inventory (should only be called for the player for now)
+ char *save(void){
+ static InventorySavePacket *isp = new InventorySavePacket();
+ isp->size = size;
+ isp->os = os;
+ isp->sel = sel;
+ return (char *)isp;
+ }
+ void load(InventorySavePacket *isp){
+ size = isp->size;
+ os = isp->os;
+ sel = isp->sel;
+ }
};
void itemUse(void *p);