[quote]If I do the loop on displayobjects (since that is what is added to the list) do I get the associated playerselection object as well?[quote]Ys and no. Here's how polymorphism works:
If you itterate through your basetype (in your example), you do get the extended types, however you can only directly manipulate objects through methods defined in the basetypes interface.
So in your case you would not be able to handleinput, without a specific downcast, however if the playerselection objects had a different implementation of showitem() than the basetype, then the playerselection version would be the one invoked.
If you itterate through your basetype (in your example), you do get the extended types, however you can only directly manipulate objects through methods defined in the basetypes interface.
So in your case you would not be able to handleinput, without a specific downcast, however if the playerselection objects had a different implementation of showitem() than the basetype, then the playerselection version would be the one invoked.