1. Are you planning to upload your awesome spell or system to Hive? Please review the rules here.
    Dismiss Notice
  2. Seek unity between the elements in the 22nd Terraining Contest Poll.
    Dismiss Notice
  3. Seize the moment! The 18th Mini Mapping Contest has commenced.
    Dismiss Notice
  4. The heavens smile on the old faithful. The 16th Techtree Contest has begun.
    Dismiss Notice
  5. Check out the Staff job openings thread.
    Dismiss Notice
Dismiss Notice
60,000 passwords have been reset on July 8, 2019. If you cannot login, read this.

Collections v0.6.0

Submitted by aznricepuff
This bundle is marked as substandard. It may contain bugs, not perform optimally or otherwise be in violation of the submission rules.

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
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.
  1. 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.
     
  2. maskedpoptart

    maskedpoptart

    Joined:
    Aug 4, 2006
    Messages:
    351
    Resources:
    1
    Spells:
    1
    Resources:
    1
    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.
     
  3. Deuterium

    Deuterium

    Joined:
    Mar 17, 2009
    Messages:
    1,301
    Resources:
    2
    Spells:
    1
    Tutorials:
    1
    Resources:
    2
    Well haha a bit too advanced for a guy like me :p
    But as I was going through it I sort of got the general idea of what it does... impressive job there :)
     
  4. The Reborn Devil

    The Reborn Devil

    Joined:
    Dec 31, 2006
    Messages:
    1,325
    Resources:
    0
    Resources:
    0
    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().")
     
  5. aznricepuff

    aznricepuff

    Joined:
    Feb 22, 2006
    Messages:
    749
    Resources:
    4
    Maps:
    2
    Spells:
    1
    Tutorials:
    1
    Resources:
    4
    Uh...that shouldn't have happened. The map compiled fine before I submitted it (I was even "playing" it).

    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.
     
  6. maskedpoptart

    maskedpoptart

    Joined:
    Aug 4, 2006
    Messages:
    351
    Resources:
    1
    Spells:
    1
    Resources:
    1
    Ah, so it wasn't your fault. You are forgiven then. Well I hope you figure out what's wrong because I want to test these out and possibly use them (assuming I can figure out what to use them for).
     
  7. Deuterium

    Deuterium

    Joined:
    Mar 17, 2009
    Messages:
    1,301
    Resources:
    2
    Spells:
    1
    Tutorials:
    1
    Resources:
    2
    It's not like it's a mistake that needs forgiveness in the first place :p
     
  8. aznricepuff

    aznricepuff

    Joined:
    Feb 22, 2006
    Messages:
    749
    Resources:
    4
    Maps:
    2
    Spells:
    1
    Tutorials:
    1
    Resources:
    4
    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.
     
  9. aznricepuff

    aznricepuff

    Joined:
    Feb 22, 2006
    Messages:
    749
    Resources:
    4
    Maps:
    2
    Spells:
    1
    Tutorials:
    1
    Resources:
    4
    Big update: 0.6.0.

    Added optional modules. Now requires jasshelper 0.9.Z.0+.