OOP Query

BlitzMax Forums/BlitzMax Beginners Area/OOP Query

The forum is locked. These are the original blitzbasic.com forums, kept so they can still be read. No new topics, replies or edits can be made here. To join in, head over to the Blitz3D+ forums.

Hi, quick OOP question. If I create a Type TFirst which contains a list of TSeconds, is there any way in which I can get an instance of TSecond to access what is in the list 'list2' (defined and belonging to TFirst)? Or is doing this a sign that I havent structured my code properly?

Thanks for any help

Type TFirst
	Field list:TList
                Field list2:TList   ' Its this list I want to access
	Function CreateSomething:TFirst()
	 	local NewSomething: TFirst
	 	NewSomething=New TFirst
	
	 	for local n=1 to 10
	   		NewSomething.list.Addlast(New TSecond)
	 	next
		return NewSomething
	EndFunction
End Type

Type TSecond
	   field x:int, y:Int
	   
End Type