From 6f53ed5d879509fecf86a136b83ba30617d1278e Mon Sep 17 00:00:00 2001 From: Federico Cecchetto Date: Sun, 11 Jul 2021 17:17:22 +0200 Subject: [PATCH] And this --- src/game/scripting/array.hpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/src/game/scripting/array.hpp b/src/game/scripting/array.hpp index f34b9c0..9150f04 100644 --- a/src/game/scripting/array.hpp +++ b/src/game/scripting/array.hpp @@ -73,6 +73,18 @@ namespace scripting { return {this->id_, this->get_value_id(key)}; } + + array_value operator[](const array_key& key) const + { + if (key.is_integer) + { + return {this->id_, this->get_value_id(key.index)}; + } + else + { + return {this->id_, this->get_value_id(key.key)}; + } + } private: unsigned int id_; };