Jump to content

  • Log In with Google      Sign In   
  • Create Account

We're offering banner ads on our site from just $5!

1. Details HERE. 2. GDNet+ Subscriptions HERE. 3. Ad upload HERE.


patrrr

Member Since 01 Oct 2005
Offline Last Active Nov 24 2014 04:13 PM

Posts I've Made

In Topic: Help with ArrayList Java

16 August 2014 - 11:50 AM

This code should theoretically work, however I haven't tested it ( getting ready for work as I type this message ) .

ArrayList <Object> Something = new ArrayList <Object>() ; 

 "Object" is a generic that should be able to hold any kind of Object .

Which is what ArrayList without the generics will result in, afaik smile.png


In Topic: Help with ArrayList Java

16 August 2014 - 03:51 AM

Thank you megadan, I now have it reading the ArrayList using Class<?>. Now my problem is adding elements to an ArrayList<Class> from ArrayList<Class<?>>.

 

Example:

ArrayList<Moves> moves;
ArrayList<Class<?>> importedMoves;

for (int x = 0; x < importedMoves.size(); x++){
moves.add(importedMoves.get(x));

Is there a way around this?

Just remove the generics all together, it seems like you don't want type checking. This can cause problems in the future though (you'll need to type cast), and it'll also make the code harder to understand.


In Topic: GPL licence question

09 July 2014 - 01:14 AM

Some GPL libraries are dual-licensed with LGPL as well, which means that you don't have to release your code if you link to the library as a dynamic library. Also, there are many libraries using, in my opinion, more sane licenses like MIT/Apache/BSD.


In Topic: Adventures of general Wudenkrup - a WWII game

25 May 2014 - 11:35 AM

Wow, this is really a special something! You have some z-fighting on those obelisks when the general lands in LeBalcon, though.


In Topic: loop break

27 April 2014 - 07:09 AM

Loops like that make it easier to remove stuff from indexed lists as well.


PARTNERS