From 96eb97cbbf8acd38a44ecb914e12aeda322d0bd4 Mon Sep 17 00:00:00 2001 From: Pawel Kowal Date: Sat, 2 Jul 2016 19:03:35 +0200 Subject: Array has(var value) function --- core/array.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'core/array.cpp') diff --git a/core/array.cpp b/core/array.cpp index bb8e52730..23792f90f 100644 --- a/core/array.cpp +++ b/core/array.cpp @@ -200,6 +200,10 @@ int Array::count(const Variant& p_value) const { return amount; } +bool Array::has(const Variant& p_value) const { + return _p->array.find(p_value, 0) != -1; +} + void Array::remove(int p_pos) { _p->array.remove(p_pos); -- cgit v1.2.3-70-g09d2