From 853e6e6882969f24547d782d42a3c19df4395064 Mon Sep 17 00:00:00 2001 From: Gargaj Date: Sat, 14 Nov 2015 16:42:26 +0100 Subject: change from single followable item to multiple --- src/Item.cpp | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'src/Item.cpp') diff --git a/src/Item.cpp b/src/Item.cpp index 97cda0b95..2eb009d4a 100644 --- a/src/Item.cpp +++ b/src/Item.cpp @@ -459,3 +459,33 @@ void cItems::Set(int a_Idx, short a_ItemType, char a_ItemCount, short a_ItemDama + +bool cItems::Contains(const cItem & a_Item) +{ + for (auto itr : *this) + { + if (a_Item.IsEqual(itr)) + { + return true; + } + } + return false; +} + + + + + +bool cItems::ContainsType(const cItem & a_Item) +{ + for (auto itr : *this) + { + if (a_Item.IsSameType(itr)) + { + return true; + } + } + return false; +} + + -- cgit v1.2.3