diff options
| author | Bojidar Marinov | 2018-03-09 21:16:08 +0200 |
|---|---|---|
| committer | Bojidar Marinov | 2018-03-13 17:18:08 +0200 |
| commit | 9f6c0c6eaef754f2049ee536c5b38bfdc65fbd08 (patch) | |
| tree | 823f108360644d6403500810f31d08d7d5e37160 /core/variant_op.cpp | |
| parent | b84236944215445be191047ab628e570ffd69e99 (diff) | |
| download | godot-9f6c0c6eaef754f2049ee536c5b38bfdc65fbd08.tar.gz godot-9f6c0c6eaef754f2049ee536c5b38bfdc65fbd08.tar.zst godot-9f6c0c6eaef754f2049ee536c5b38bfdc65fbd08.zip | |
Diffstat (limited to 'core/variant_op.cpp')
| -rw-r--r-- | core/variant_op.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/core/variant_op.cpp b/core/variant_op.cpp index 97b469861..8d3030519 100644 --- a/core/variant_op.cpp +++ b/core/variant_op.cpp @@ -3415,6 +3415,19 @@ Variant Variant::iter_get(const Variant &r_iter, bool &r_valid) const { return Variant(); } +Variant Variant::duplicate(bool deep) const { + switch (type) { + // case OBJECT: + // return operator Object *()->duplicate(); + case DICTIONARY: + return operator Dictionary().duplicate(deep); + case ARRAY: + return operator Array().duplicate(deep); + default: + return *this; + } +} + void Variant::blend(const Variant &a, const Variant &b, float c, Variant &r_dst) { if (a.type != b.type) { if (a.is_num() && b.is_num()) { |
