We are about to switch to a new forum software. Until then we have removed the registration on this forum.
hi, iam using an array list to store an object of class entity, which is a parent to classes weapon and tribute. i want to be able to do:
where pickUp is a function of the subclass weapon; however i cannot do that as i get a, "function doesnt exist" error, now i havent actually tried it but would
weapon temp = (weapon)entitiesList.get(currentEntity.getID()); temp.pickUp();
that work ? would the weapon object created point to the original, or would it be a new object ? if it is the latter, then is there any way i can store the originals in one arraylist and then use two other arraylists to store weapons and tributes as pointers to the original array ?,