Raw code if you want to test it yourself
function Test(_value) constructor {
if(live_call(_value)) return live_result;
obj_list = [];
value = _value;
static get_sum =function()/*=>*/ {
var _sum = value,
_objIndex = 0;;
repeat(array_length(obj_list)){
_sum += obj_list[_objIndex++].get_sum();
}
return _sum;
};
static add_obj =function(_obj)/*=>*/ {
array_push(obj_list, _obj);
};
}
var _obj = new Test(3);
_obj.add_obj(new Test(5));
_obj.add_obj(new Test(9));
show_debug_message(_obj.get_sum());