]> git.localhorst.tv Git - l2e.git/blobdiff - src/common/Inventory.h
removed stupid file headers that eclipse put in
[l2e.git] / src / common / Inventory.h
index 2443078c708389bf72fc004d150b4a85fea53ce6..bb8f59964913d2f33e1c07e40e905a083e9e577d 100644 (file)
@@ -1,19 +1,12 @@
-/*
- * Inventory.h
- *
- *  Created on: Aug 9, 2012
- *      Author: holy
- */
-
 #ifndef COMMON_INVENTORY_H_
 #define COMMON_INVENTORY_H_
 
+#include "fwd.h"
+
 #include <SDL.h>
 
 namespace common {
 
-class Item;
-
 class Inventory {
 
 public:
@@ -22,17 +15,27 @@ public:
 public:
        bool Add(const Item *, int count = 1);
        void Remove(const Item *, int count = 1);
+       void RemoveAll(const Item *);
 
        int MaxItems() const { return 96; }
 
+       bool AddScenarioItem(const Item *);
+       const Item *ScenarioItemAt(int offset) const { return scenario[offset]; }
+       int NumScenarioItems() const { return scenarioEnd; }
+       int MaxScenarioItems() const { return 64; }
+
        const Item *ItemAt(int offset) const { return entries[offset].item; }
        int ItemCountAt(int offset) const { return entries[offset].count; }
 
+       void Sort();
+       void SwapEntriesAt(int lhs, int rhs);
+
 private:
        struct Entry {
                Entry() : item(0), count(0) { }
                const Item *item;
                Uint8 count;
+               static bool Less(const Entry &, const Entry &);
        };
 
 private:
@@ -42,6 +45,8 @@ private:
 
 private:
        Entry entries[96];
+       const Item *scenario[64];
+       int scenarioEnd;
 
 };