   Program VB tools with C++
  Hey everyone, I've been programming a game for the last 18 months using VB.  Luckily at the moment it’s all text based spread sheet management.  However, the theory is being applied and once the concept is playable, it will be easier to convert to a real gaming engine.  (Don't worry, I know this process is where the development team needs to actually do major major work.  I'm just testing to see if what I'm envisioning in my head is doable in a simple form)What I'm coming across is a problem with the toolbox tools I'm using to simulate some AI aspects of the game.  For the type of AI I've envisioned I need a collections class that's got many more options.  So for instance, right now I can use a collections class as follows.peopleeating = NEW collectionfor z = 1 to 30peopleeating.add(z)next zHowever, right now the collections class only has a limited number of commands, like .add .remove() and maybe one or two more that are useless to me.Now, the listbox has many more options, however, the list box is a huge muncher of resources, but I can do things like .sort .add .addat() .removeat() .clear and so forth.I want to make my own additions.  I want to program stuff like .average .sorthigh .sortlow .medium .maximum . minimum and so forth.  If someone could begin helping shed light on how I could do this, it would be much appreciated.  And if your answer is going to be "Learn C++" then..... then.....  then I don't know.   I'm willing to learn what I need to, but I don't have the time right now to tackle such a major undertaking.  But I'm more than willing to learn the parts of C++ that will let me accomplish this end goal. Is anybody able to help?   
  Assuming VB.net 2008, you can use extension methods to augment existing classes.That said, the Generic.List<T> class already provides most of the stuff you mention. You could extend that instead of a generic collection to save some work.If the built-in collections simply fail to provide the functionality you require, the last-resort option is to implement your own collection class. This isn't as difficult as it sounds, but it does require more than a few lines of code. In order for the .net framework to consider your class as a collection, you need to implement at least the ICollection (and preferably IEnumerable) interfaces.In C++, the equivalent to List would be std::vector which you can manipulate with stl algorithms or create your own algorithms.   ;  ROFL, nicely done.  I don't know what's gonna take me longer, figureing out what the hell you just said or learning C++.But seriously though, thank you.;  While learning C++ for just this particular feature is overkill, there are many good reasons for learning it. That said, VB is also a very capable language nowadays and it is possible to implement almost any type of program with it (except kernel-level stuff such as hardware abstraction layers or drivers).If you need help on specific features of VB, come back to the forums and ask :)Also, follow the links I posted. The second link leads you to sample code that demonstrates the usage of List<T> in VB.net 2008. If you've been using at least some kind of collection class previously, using List is very easy.   ;  Nik02, thanks, you're the man, as we say in my neck of the woods.  I'll definitly search it out.Cheers   