Quantcast
Channel: Latest Questions by Kaputnik88
Viewing all articles
Browse latest Browse all 21

Accessing properties/functions of different class instances in the same list

$
0
0
Hey there, So I'm working on a project where I have a list storing instances of different classes. I want to be able to access these class instances and alter them while iterating through the list. The method I've seen (and am using) is something like this: for(child in list){ if(child.GetType==exampleclass){ var inst : exampleclass = child; //changes here } } I'm wondering if there is a method for this that dosent require a bunch of if statements for every possible class type, something like: for(child in list){ var inst : child.GetType() = child; //changes here }

Viewing all articles
Browse latest Browse all 21

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>