Quellcode durchsuchen

[Core] Add `LocalVector::has` for convenience

A Thousand Ships vor 1 Jahr
Ursprung
Commit
505076c9a9
1 geänderte Dateien mit 4 neuen und 0 gelöschten Zeilen
  1. 4 0
      include/godot_cpp/templates/local_vector.hpp

+ 4 - 0
include/godot_cpp/templates/local_vector.hpp

@@ -257,6 +257,10 @@ public:
 		return -1;
 	}
 
+	bool has(const T &p_val) const {
+		return find(p_val) != -1;
+	}
+
 	template <typename C>
 	void sort_custom() {
 		U len = count;