• 🏆 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!

Collections v0.6.0

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

Collections


v0.6.0

A pack of collections (group) implementations meant to make working with dynamically-created collections of structs less of a hassle.

Also includes several map implementations for your associative array needs.

The demo map contains prewritten "unit" tests for some of the implementations as well as a Blackjack game written using multiple collection implementations. You can activate the unit tests as well as play Blackjack (with multiple human players) by playing the demo map.

Features
  • Provides standard framework from which to implement sets, lists, and maps.
  • Comprehensive yet simple API that abstracts away all of the messy code that users shouldn't need to deal with.
  • Robust methods of iterating over collections that guarantee deterministic behavior while modifying collections during the iteration.
  • Maps that provide collections views of themselves.
  • Implementations to satisfy multiple niches: ordered/unordered sets and maps, queues, stacks, double-ended queues, arrays, etc.
  • Flexibility to create collections of collections, maps of collections, collections of maps, maps of maps, collections of collections of collections, etc.
  • Dynamic arrays without the 8190 size limit whose sizes can be specified at run-time.
  • Optional modules that provide even greater functionality if you need it, including sorting and binary search.

Included Implementations:
  • LinkedHashSet
  • TreeSet
  • BalancedTreeSet
  • ArrayList
  • LinkedList
  • LinkedHashMap
  • TreeMap
  • BalancedTreeMap

Included Modules:
  • Sort
  • StableSort
  • Selection
  • BinarySearch

Requires
  • jasshelper 0.9.Z.0+

See the demo map for the changelog.

Keywords:
collection, map, dynamic array, associative array, set, list, linked list, array list, hash set, tree set, hash map, tree map
Contents

Collections v0.6.0 (Map)

Reviews
19:52, 26th Oct 2009 TriggerHappy187: Don't you think this should be in the Jass submission forum? Yes, it has a demo map though it's not needed (but a very good idea to include with libraries like this). PM me if you feel different.

Moderator

M

Moderator

19:52, 26th Oct 2009
TriggerHappy187:

Don't you think this should be in the Jass submission forum?

Yes, it has a demo map though it's not needed (but a very good idea to include with libraries like this).

PM me if you feel different.
 
Level 8
Joined
Aug 4, 2006
Messages
357
OH this looks interesting. I haven't bothered to read everything, but I would suggest explaining what to use each type of collection for, in the documentation. Otherwise, people with limited programming experience will not know how to use these in wc3. I also found two compile errors:
1) Systems\LinkedHashSet. Line 117: t is not a member of ACollection.
2) Systems\ArrayList. Line 212: Missing return.
You didn't even check for compile errors before submitting? I must say I'm a little dissapointed in you aznricepuff :wink: Fix those so I can test this awesome stuff out.
 
Level 22
Joined
Dec 31, 2006
Messages
2,216
You're missing a return in trigger "ArrayList". Also, my wc3 shuts down after the wait that is under this line: call BJDebugMsg(PREFIX + "Beginning test of TreeSet.size().")
 
Level 11
Joined
Feb 22, 2006
Messages
752
You didn't even check for compile errors before submitting?

Uh...that shouldn't have happened. The map compiled fine before I submitted it (I was even "playing" it).

You're missing a return in trigger "ArrayList". Also, my wc3 shuts down after the wait that is under this line: call BJDebugMsg(PREFIX + "Beginning test of TreeSet.size().")

Ok, same as above, my compiler isn't flagging any errors. And I just tested that and I got the same crash (though later), which I wasn't getting before. Wtf...

You can completely ignore the update I just put up then while I figure out wtf is going on.
 
Level 11
Joined
Feb 22, 2006
Messages
752
Ok, updated, then hive stopped working for 20 min before I could make this post.

I was JUST playing this (20 min ago) and I saved the thing three times before I uploaded it. No errors on my end.

Fixed that TreeSet error...which was also in TreeMap.

Added small sections in the Docs with a short description of the situations in which you might want to use that specific implementation and what those implementations are generally used for/are good at.

Also made some additions to the demo map, which were technically already in 0.4.1 but that version was really short-lived.
 
Top