• 🏆 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!
  • It's time for the first HD Modeling Contest of 2024. Join the theme discussion for Hive's HD Modeling Contest #6! Click here to post your idea!

vJASS template class (like c++)

This bundle is marked as useful / simple. Simplicity is bliss, low effort and/or may contain minor bugs.

- This requires vJASS (go figure)
- You require W.E. with vJASS injector code to use this system (like This one)



Q: is it magic?
A: No.....

Q: Is it real?
A: yes.

Q: how does it worx?
A: its a very fancy linked list

Q: Is it syntactically clean?
A: sorta





Make sure you see the subtopic labled "textmacros"





[jass=genericList]
//genericList template class
//written by UnholyDecimator
// 12/6/15


//! textmacro genList takes listType, getterName, structName
struct $structName$
$listType$ cur
thistype next

public static method create takes $listType$ r returns thistype
local thistype new
set new = .allocate()

set new.cur = r
set new.next = 0

return new
endmethod

public method get$getterName$ takes nothing returns $listType$
return cur
endmethod

public method isChild takes nothing returns boolean
if (next == 0) then
return false
endif

return true
endmethod

public method attachChild takes $listType$ r returns nothing
set next = thistype.create(r)
endmethod

public method getChild takes nothing returns thistype
if (isChild()) then
return next
endif

return 0
endmethod

public method destroy takes nothing returns nothing
if(isChild()) then
call next.destroy()
endif
set cur = null
set next = 0
call .deallocate()
endmethod
endstruct

//! endtextmacro

[/code]



[jass=raceList]
//! runtextmacro genList("string", "String", "stringList")
[/code]



dfjcet.png





Keywords:
vJASS, templace, class, example
Contents

templateList (Map)

Reviews
IcemanBo: Hided the system. A new thread was opened in Lab: http://www.hiveworkshop.com/forums/submissions-414/example-template-class-generic-linked-list-moved-upon-request-user-bribe-273363/ 05:25, 7th Dec 2015 Bribe: vJass Template Class isn't...

Moderator

M

Moderator

IcemanBo: Hided the system. A new thread was opened in Lab:
http://www.hiveworkshop.com/forums/...ed-list-moved-upon-request-user-bribe-273363/

05:25, 7th Dec 2015
Bribe: vJass Template Class isn't exactly right. This is a linked list generated via textmacro. I see these kinds of submissions in the JASS section a fee times per year.

Some approved/pending resources which do the same or similar with or without the macro:

http://www.hiveworkshop.com/forums/jass-resources-412/snippet-stack-224866/

http://www.hiveworkshop.com/forums/jass-resources-412/snippet-linkedlistmodule-206552/

This pending resource seems like the closest relative to what you've submitted: http://www.hiveworkshop.com/forums/submissions-414/containers-list-t-249011/

There exist dozens in the graveyard: http://www.hiveworkshop.com/forums/graveyard-418/

Nestharus, my most influential mentor, had many lists approved here on The Hive. Now, they are all here: https://github.com/nestharus

This resource would be better in the JASS Resources section since it is an abstract snippet. Please re-submit it here: http://www.hiveworkshop.com/forums/submissions-414/
 
Top