这里我确认一下
例如这个函数 单位组添加单位组
function GroupAddGroup takes group sourceGroup, group destGroup returns nothing // If the user wants the group destroyed, remember that fact and clear
// the flag, in case it is used again in the callback.
local boolean wantDestroy = bj_wantDestroyGroup
set bj_wantDestroyGroup = false
set bj_groupAddGroupDest = destGroup
call ForGroup(sourceGroup, function GroupAddGroupEnum)
// If the user wants the group destroyed, do so now.
if (wantDestroy) then
call DestroyGroup(sourceGroup)
endif
endfunction
如果我的理解没错
在这些带有这个布尔值的函数开头
都会把这个布尔值
先局部记录然后设置为默认值false
换言之在单位组前面加上一句
set bj_wantDestroyGroup = true 是可以起到在某些单位组函数内清单位组的作用的
是这样的吗。
求各位的看法
例如这个函数 单位组添加单位组
function GroupAddGroup takes group sourceGroup, group destGroup returns nothing // If the user wants the group destroyed, remember that fact and clear
// the flag, in case it is used again in the callback.
local boolean wantDestroy = bj_wantDestroyGroup
set bj_wantDestroyGroup = false
set bj_groupAddGroupDest = destGroup
call ForGroup(sourceGroup, function GroupAddGroupEnum)
// If the user wants the group destroyed, do so now.
if (wantDestroy) then
call DestroyGroup(sourceGroup)
endif
endfunction
如果我的理解没错
在这些带有这个布尔值的函数开头
都会把这个布尔值
先局部记录然后设置为默认值false
换言之在单位组前面加上一句
set bj_wantDestroyGroup = true 是可以起到在某些单位组函数内清单位组的作用的
是这样的吗。
求各位的看法