aboutsummaryrefslogtreecommitdiff
path: root/engines/xeen/items.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2015-02-04 20:22:59 -0500
committerPaul Gilbert2015-02-04 20:22:59 -0500
commit8eb9ad50f8ddf23147b999fa40c6231a1a623d41 (patch)
tree1d0d34dcf4b41500272ce60a571725b5fb5243c5 /engines/xeen/items.cpp
parent4953b7954aca078be9655971f925f82c51e472db (diff)
downloadscummvm-rg350-8eb9ad50f8ddf23147b999fa40c6231a1a623d41.tar.gz
scummvm-rg350-8eb9ad50f8ddf23147b999fa40c6231a1a623d41.tar.bz2
scummvm-rg350-8eb9ad50f8ddf23147b999fa40c6231a1a623d41.zip
XEEN: Split Character class into it's own file
Diffstat (limited to 'engines/xeen/items.cpp')
-rw-r--r--engines/xeen/items.cpp86
1 files changed, 0 insertions, 86 deletions
diff --git a/engines/xeen/items.cpp b/engines/xeen/items.cpp
index 13418262bd..b9b531db7b 100644
--- a/engines/xeen/items.cpp
+++ b/engines/xeen/items.cpp
@@ -25,92 +25,6 @@
namespace Xeen {
-XeenItem::XeenItem() {
- clear();
-}
-
-void XeenItem::clear() {
- _material = _id = _bonusFlags = 0;
- _frame = 0;
-}
-
-void XeenItem::synchronize(Common::Serializer &s) {
- s.syncAsByte(_material);
- s.syncAsByte(_id);
- s.syncAsByte(_bonusFlags);
- s.syncAsByte(_frame);
-}
-
-int XeenItem::getElementalCategory() const {
- int idx;
- for (idx = 0; ELEMENTAL_CATEGORIES[idx] < _material; ++idx)
- ;
-
- return idx;
-}
-
-int XeenItem::getAttributeCategory() const {
- int m = _material - 59;
- int idx;
- for (idx = 0; ATTRIBUTE_CATEGORIES[idx] < m; ++idx)
- ;
-
- return idx;
-}
-
-/*------------------------------------------------------------------------*/
-
-InventoryItems::InventoryItems() : Common::Array<XeenItem>((XeenItem *)nullptr, INV_ITEMS_TOTAL) {
-}
-
-void InventoryItems::discardItem(int itemIndex) {
- operator[](itemIndex).clear();
- sort();
-}
-
-void InventoryItems::sort() {
- for (uint idx = 0; idx < size(); ++idx) {
- if (operator[](idx)._id == 0) {
- // Found empty slot
- operator[](idx).clear();
-
- // Scan through the rest of the list to find any item
- for (uint idx2 = idx + 1; idx2 < size(); ++idx2) {
- if (operator[](idx2)._id) {
- // Found an item, so move it into the blank slot
- operator[](idx) = operator[](idx2);
- operator[](idx2).clear();
- break;
- }
- }
- }
- }
-}
-
-void InventoryItems::equipItem(int itemIndex) {
- error("TODO");
-}
-
-void InventoryItems::removeItem(int itemIndex) {
- error("TODO");
-}
-
-/*------------------------------------------------------------------------*/
-
-InventoryItemsGroup::InventoryItemsGroup(InventoryItems &weapons, InventoryItems &armor,
- InventoryItems &accessories, InventoryItems &misc) {
- _itemSets[0] = &weapons;
- _itemSets[1] = &armor;
- _itemSets[2] = &accessories;
- _itemSets[3] = &misc;
-}
-
-InventoryItems &InventoryItemsGroup::operator[](ItemCategory category) {
- return *_itemSets[category];
-}
-
-/*------------------------------------------------------------------------*/
-
Treasure::Treasure() {
_hasItems = false;
}