Base Class Refer to It's Child Class?!

BlitzMax Forums/BlitzMax Beginners Area/Base Class Refer to It's Child Class?!

BLaBZ(Posted 2010) [#1]
Is it possible?!

If I were to loop through a list of Base class's is here a way I could refer to their extended class IF it was a certain class?


Zeke(Posted 2010) [#2]
For Local b:basetype = EachIn list
	Local child:tchildtype = tchildtype(b)
	If child
		'do something
	EndIf
Next



Czar Flavius(Posted 2010) [#3]
However, if you need to do that there is probably something wrong with your design, as OO is designed so that you don't need to do that. You should put child-specific data in the child's methods. If you show some code I can make suggestions.