获取属性接口
This commit is contained in:
parent
e45fa5b862
commit
6ac9e059fb
|
|
@ -385,23 +385,23 @@ function deepcopy(obj) {
|
|||
|
||||
function _deepcopy(obj, copies) {
|
||||
local type = typeof obj;
|
||||
|
||||
|
||||
// 处理基本类型
|
||||
if (type != "table" && type != "array" && type != "class" && type != "instance") {
|
||||
return obj;
|
||||
}
|
||||
|
||||
|
||||
// 处理循环引用
|
||||
if (obj in copies) {
|
||||
return copies[obj];
|
||||
}
|
||||
|
||||
|
||||
// 创建新容器
|
||||
local newObj;
|
||||
if (type == "array") {
|
||||
newObj = array(obj.len());
|
||||
copies[obj] <- newObj; // 在拷贝前记录
|
||||
|
||||
|
||||
for (local i = 0; i < obj.len(); i++) {
|
||||
newObj[i] = _deepcopy(obj[i], copies);
|
||||
}
|
||||
|
|
@ -409,7 +409,7 @@ function _deepcopy(obj, copies) {
|
|||
else if (type == "table") {
|
||||
newObj = {};
|
||||
copies[obj] <- newObj; // 在拷贝前记录
|
||||
|
||||
|
||||
foreach(key, val in obj) {
|
||||
// 键也需要深拷贝
|
||||
local newKey = _deepcopy(key, copies);
|
||||
|
|
@ -421,6 +421,10 @@ function _deepcopy(obj, copies) {
|
|||
newObj = obj;
|
||||
copies[obj] <- newObj;
|
||||
}
|
||||
|
||||
|
||||
return newObj;
|
||||
}
|
||||
|
||||
function sq_GetCharacterAttribute(address){
|
||||
return L_sq_GetCharacterAttribute(address);
|
||||
}
|
||||
Loading…
Reference in New Issue