|
关于1.23a到1.23b的变化看这边
http://bbs.islga.org/read-htm-tid-28544.html
再补充一条:
1.23b相比1.23a增加了一条
[jass]constant native GetTriggerDestructable takes nothing returns destructable[/jass]
可以直接获得触发事件的可破坏物,不需要通过Widget了
然后1.23b到1.24a之间的变化,第一点wisp同学已经有说过了。就是增加了agent类型,把handle细分为agent和非agent 。如
[jass]
type agent extends handle // all reference counted objects
type event extends agent // a reference to an event registration
type player extends agent // a single player reference
type widget extends agent // an interactive game object with life
type unit extends widget // a single unit reference
type destructable extends widget
type item extends widget
type ability extends agent
type buff extends ability
type force extends agent
type group extends agent
type trigger extends agent
type triggercondition extends agent
type triggeraction extends handle
//………………
type gamestate extends handle
[/jass]
即有实际指向对象(其实更标准的说法是一切需要计算变量连接数的对象)的变量类型,将继承自agent。然后agent再继承自handle。方便归类。以这里为例的话,trigger就属于agent的handle而gamestate则属于非agent,因为它其实只是拿来保存整数的变量而已,和integer的作用没有区别。
然后别的变化是增加了
[jass]
constant native GetSpellTargetX takes nothing returns real
constant native GetSpellTargetY takes nothing returns real
[/jass]
可以直接获得技能目标点的X和Y坐标,这样就可以省去以前用GetSpellTargetLoc()时会创建一个点对象的麻烦了。
实际功能方面
[jass]
native SaveAgentHandle takes hashtable table, integer parentKey, integer childKey, agent whichAgent returns boolean
native SaveHashtableHandle takes hashtable table, integer parentKey, integer childKey, hashtable whichHashtable returns boolean
native LoadHashtableHandle takes hashtable table, integer parentKey, integer childKey returns hashtable
[/jass]
前一条只是为了能把新类型也存入哈希表而已。后两条比较重要,现在1.24允许把哈希表自身作为元素来保存进哈希表,这样就可以非常方便地做出相链接的多重哈希表了。
另外Blizzard.j中除了把agent类型和表中表功能GUI化以外,还修正了1.23b中的一处非常土的BUG。
[jass]
//1.23b中的HaveSavedValue()
function HaveSavedValue takes integer key, integer valueType, integer missionKey, hashtable table returns boolean
if (valueType == bj_HASHTABLE_BOOLEAN) then
return HaveSavedBoolean(table, missionKey, key)
elseif (valueType == bj_HASHTABLE_INTEGER) then
return HaveSavedInteger(table, missionKey, key)
elseif (valueType == bj_HASHTABLE_REAL) then
return HaveSavedReal(table, missionKey, key)
elseif (valueType == bj_HASHTABLE_STRING) then
return HaveSavedString(table, missionKey, key)
elseif (valueType == bj_HASHTABLE_STRING) then //竟然出现2处bj_HASHTABLE_STRING
return HaveSavedHandle(table, missionKey, key)
else
// Unrecognized value type - ignore the request.
return false
endif
endfunction
//1.24A中的HaveSavedValue()
function HaveSavedValue takes integer key, integer valueType, integer missionKey, hashtable table returns boolean
if (valueType == bj_HASHTABLE_BOOLEAN) then
return HaveSavedBoolean(table, missionKey, key)
elseif (valueType == bj_HASHTABLE_INTEGER) then
return HaveSavedInteger(table, missionKey, key)
elseif (valueType == bj_HASHTABLE_REAL) then
return HaveSavedReal(table, missionKey, key)
elseif (valueType == bj_HASHTABLE_STRING) then
return HaveSavedString(table, missionKey, key)
elseif (valueType == bj_HASHTABLE_HANDLE) then //修正为 bj_HASHTABLE_HANDLE了。
return HaveSavedHandle(table, missionKey, key)
else
// Unrecognized value type - ignore the request.
return false
endif
endfunction
[/jass] |
评分
-
查看全部评分
|