• 🏆 Texturing Contest #33 is OPEN! Contestants must re-texture a SD unit model found in-game (Warcraft 3 Classic), recreating the unit into a peaceful NPC version. 🔗Click here to enter!
  • 🏆 Hive's 6th HD Modeling Contest: Mechanical is now open! Design and model a mechanical creature, mechanized animal, a futuristic robotic being, or anything else your imagination can tinker with! 📅 Submissions close on June 30, 2024. Don't miss this opportunity to let your creativity shine! Enter now and show us your mechanical masterpiece! 🔗 Click here to enter!
Another little hidden resource by me. Much smaller than typical utility systems and much faster.
maddeem

Another little hidden resource by me. Much smaller than typical utility systems and much faster.

JASS:
library GroupUtils initializer init
globals
private integer AMOUNT=64
private group array GROUPS
private boolean array USED
private integer array ID
private integer array ATTACH
endglobals
function NewGroupEx takes integer ii returns group
local integer i=0
loop
set i=i+1
exitwhen USED[i]==false
endloop
set USED[i]=true
set ATTACH[i]=ii
return GROUPS[i]
endfunction
function GetGroupData takes group g returns integer
local integer i=0
local integer id=GetHandleId(g)
loop
set i=i+1
exitwhen id=ID[i]
endloop
return ATTACH[i]
endfunction
function SetGroupData takes group g integer ii returns nothing
local integer i=0
local integer id=GetHandleId(g)
loop
set i=i+1
exitwhen id=ID[i]
endloop
set ATTACH[i]=ii
endfunction
function NewGroup takes nothing returns group
local integer i=0
loop
set i=i+1
exitwhen USED[i]==false
endloop
set USED[i]=true
return GROUPS[i]
endfunction
function ReleaseGroup takes group g returns nothing
local integer id=GetHandleId(g)
local integer i=0
loop
set i=i+1
exitwhen id==ID[i]
endloop
call GroupClear(g)
set USED[i]=false
endfunction
private function init takes nothing returns nothing
local integer i=0
loop
set i=i+1
exitwhen i==AMOUNT
set GROUPS[i]=CreateGroup()
set USED[i]=false
set ID[i]=GetHandleId(GROUPS[i])
set ATTACH[i]=0
endloop
endfunction
endlibrary
 

Media information

Album
Coding
Added by
maddeem
Date added
View count
302
Comment count
1
Rating
0.00 star(s) 0 ratings

Share this media

Top