diff options
author | worktycho <work.tycho@gmail.com> | 2015-11-23 23:57:59 +0100 |
---|---|---|
committer | worktycho <work.tycho@gmail.com> | 2015-11-23 23:57:59 +0100 |
commit | 2d408e864706a4dd8d7c227edefd281f6a627895 (patch) | |
tree | 5ebe9e808e82c22a427429881526fb0ce390deb4 /src/Item.cpp | |
parent | Fixed display of helpmessage (diff) | |
parent | change from single followable item to multiple (diff) | |
download | cuberite-2d408e864706a4dd8d7c227edefd281f6a627895.tar cuberite-2d408e864706a4dd8d7c227edefd281f6a627895.tar.gz cuberite-2d408e864706a4dd8d7c227edefd281f6a627895.tar.bz2 cuberite-2d408e864706a4dd8d7c227edefd281f6a627895.tar.lz cuberite-2d408e864706a4dd8d7c227edefd281f6a627895.tar.xz cuberite-2d408e864706a4dd8d7c227edefd281f6a627895.tar.zst cuberite-2d408e864706a4dd8d7c227edefd281f6a627895.zip |
Diffstat (limited to '')
-rw-r--r-- | src/Item.cpp | 30 |
1 files changed, 30 insertions, 0 deletions
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; +} + + |