Referring to an Extended Type in Parent's Method?

BlitzMax Forums/BlitzMax Beginners Area/Referring to an Extended Type in Parent's Method?

Gabriel(Posted 2005) [#1]
Still trying to get a handle on how far I can go with OOP here.

Suppose I have a lot of types derived from other types, thus :

Type A
End Type

Type 1 Extends A
End Type
Type 2 Extends A
End Type
Type 3 Extends A
End Type

Type B Extends 1
End Type
Type C Extends 1
End Type
Type D Extends 1
End Type

Type E Extends 2
End Type
Type F Extends 2
End Type
Type G Extends 2
End Type

Type H Extends 3
End Type
Type I Extends 3
End Type
Type J Extends 3
End Type



Now let's suppose I want to keep a list of all the extended types ( B-J ) but local to those types. EG: I don't want a list in A which includes all of the different types B-J, I just want a list of B's in B a list of C's in C, etc.

Is there a way to just have the global list and method defined once? At face value, it seems like it's not possible, but I'm just wondering if I've missed something here. Seems like a waste to have to have the same method in every derived type, but if it's inherited from A or even 1,2 or 3, it'll add the object to a list which combines all the different types, won't it?