From 20ea0acbec97ac7ea1fd405191ae1db1a1722302 Mon Sep 17 00:00:00 2001 From: Mitchell Richters Date: Sat, 21 Aug 2021 13:34:58 +1000 Subject: [PATCH] - Add `Contains()` method to `TArray` class, returning a true/false bool as appropriate. --- source/common/utility/tarray.h | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/source/common/utility/tarray.h b/source/common/utility/tarray.h index 635f1cc75..2aaf5c0cf 100644 --- a/source/common/utility/tarray.h +++ b/source/common/utility/tarray.h @@ -292,6 +292,17 @@ public: return i; } + bool Contains(const T& item) const + { + unsigned int i; + for(i = 0;i < Count;++i) + { + if(Array[i] == item) + return true; + } + return false; + } + template unsigned int FindEx(Func compare) const {