diff options
Diffstat (limited to 'core/variant/array.h')
-rw-r--r-- | core/variant/array.h | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/core/variant/array.h b/core/variant/array.h index 4a1b25c4a9..72bed5932c 100644 --- a/core/variant/array.h +++ b/core/variant/array.h @@ -5,8 +5,8 @@ /* GODOT ENGINE */ /* https://godotengine.org */ /*************************************************************************/ -/* Copyright (c) 2007-2021 Juan Linietsky, Ariel Manzur. */ -/* Copyright (c) 2014-2021 Godot Engine contributors (cf. AUTHORS.md). */ +/* Copyright (c) 2007-2022 Juan Linietsky, Ariel Manzur. */ +/* Copyright (c) 2014-2022 Godot Engine contributors (cf. AUTHORS.md). */ /* */ /* Permission is hereby granted, free of charge, to any person obtaining */ /* a copy of this software and associated documentation files (the */ @@ -33,6 +33,8 @@ #include "core/typedefs.h" +#include <climits> + class Variant; class ArrayPrivate; class Object; @@ -44,8 +46,6 @@ class Array { void _ref(const Array &p_from) const; void _unref() const; - inline int _clamp_slice_index(int p_index) const; - protected: Array(const Array &p_base, uint32_t p_type, const StringName &p_class_name, const Variant &p_script); bool _assign(const Array &p_array); @@ -63,8 +63,10 @@ public: bool operator==(const Array &p_array) const; bool operator!=(const Array &p_array) const; + bool recursive_equal(const Array &p_array, int recursion_count) const; uint32_t hash() const; + uint32_t recursive_hash(int recursion_count) const; void operator=(const Array &p_array); void push_back(const Variant &p_value); @@ -73,7 +75,7 @@ public: Error resize(int p_new_size); Error insert(int p_pos, const Variant &p_value); - void remove(int p_pos); + void remove_at(int p_pos); void fill(const Variant &p_value); Variant front() const; @@ -100,8 +102,9 @@ public: Variant pop_at(int p_pos); Array duplicate(bool p_deep = false) const; + Array recursive_duplicate(bool p_deep, int recursion_count) const; - Array slice(int p_begin, int p_end, int p_step = 1, bool p_deep = false) const; + Array slice(int p_begin, int p_end = INT_MAX, int p_step = 1, bool p_deep = false) const; Array filter(const Callable &p_callable) const; Array map(const Callable &p_callable) const; Variant reduce(const Callable &p_callable, const Variant &p_accum) const; |