]> git.localhorst.tv Git - l2e.git/blobdiff - src/common/Inventory.cpp
added capsule feed menu dummy
[l2e.git] / src / common / Inventory.cpp
index d8ba20c08af5a35c0af1d1311ab2474259634449..e279ac5856d0b608a1866fd97a3e26193f16286a 100644 (file)
@@ -1,10 +1,3 @@
-/*
- * Inventory.cpp
- *
- *  Created on: Aug 9, 2012
- *      Author: holy
- */
-
 #include "Inventory.h"
 
 #include "Item.h"
@@ -14,7 +7,8 @@
 
 namespace common {
 
-Inventory::Inventory() {
+Inventory::Inventory()
+: scenarioEnd(0) {
 
 }
 
@@ -71,6 +65,17 @@ bool Inventory::SloteFree(int offset) const {
 }
 
 
+bool Inventory::AddScenarioItem(const Item *i) {
+       if (scenarioEnd < MaxScenarioItems()) {
+               scenario[scenarioEnd] = i;
+               ++scenarioEnd;
+               return true;
+       } else {
+               return false;
+       }
+}
+
+
 void Inventory::Sort() {
        std::sort(entries, entries + 96, Entry::Less);
 }