wurstscript / WurstScript

Programming language and toolkit to create Warcraft III Maps

Home Page:https://wurstlang.org

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[compiletime] `BlzGroupAddGroupFast` must return the number of added units

GetLocalPlayer opened this issue · comments

In addition, it must check if added unit is already in the group.

@Test
function test()
	let list = new LinkedList<unit>
	for i = 0 to 9
		list.add(createUnit(localPlayer, 'hfoo', ZERO2, angle(0)))
	let g = CreateGroup()
	let a = CreateGroup()
	..add(list.get(0), list.get(1), list.get(2), list.get(3), list.get(4))
	let b = CreateGroup()
	..add(list.get(2), list.get(3), list.get(4), list.get(5))
	print(BlzGroupAddGroupFast(a, g))
	print(BlzGroupAddGroupFast(b, g))
	print("size = " + g.size().toString())

init
	doAfter(1) ->
		test()

Ingame output:
Screenshot_5

Compiletime output:

Running <Hello:7 - test>..
5
9
size = 9
	OK!
Tests succeeded: 1/1