1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Add search methods for packed arrays

* count()
* find()
* rfind()
This commit is contained in:
Haoyu Qiu
2022-05-07 20:16:11 +08:00
parent 563690347a
commit 380a53f02f
12 changed files with 268 additions and 0 deletions

View File

@@ -92,6 +92,8 @@ public:
_FORCE_INLINE_ const T &operator[](int p_index) const { return _cowdata.get(p_index); }
Error insert(int p_pos, T p_val) { return _cowdata.insert(p_pos, p_val); }
int find(const T &p_val, int p_from = 0) const { return _cowdata.find(p_val, p_from); }
int rfind(const T &p_val, int p_from = -1) const { return _cowdata.rfind(p_val, p_from); }
int count(const T &p_val) const { return _cowdata.count(p_val); }
void append_array(Vector<T> p_other);