mirror of
https://github.com/godotengine/godot.git
synced 2025-10-19 16:03:29 +00:00
add pop_back/pop_front/push_back/push_front to array, to make it according to doc, fixes #3040
This commit is contained in:
parent
a73cf7f794
commit
b191e740d2
3 changed files with 29 additions and 1 deletions
|
@ -222,6 +222,24 @@ void Array::invert(){
|
|||
}
|
||||
|
||||
|
||||
void Array::push_front(const Variant& p_value) {
|
||||
|
||||
_p->array.insert(0,p_value);
|
||||
}
|
||||
|
||||
void Array::pop_back(){
|
||||
|
||||
if (!_p->array.empty())
|
||||
_p->array.resize( _p->array.size() -1 );
|
||||
|
||||
}
|
||||
void Array::pop_front(){
|
||||
|
||||
if (!_p->array.empty())
|
||||
_p->array.remove(0);
|
||||
|
||||
}
|
||||
|
||||
|
||||
Array::Array(const Array& p_from) {
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue