OOP... If You Don't Wanna Hear It From Me...

Miscellaneous Forums/General Discussion/OOP... If You Don't Wanna Hear It From Me...

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.

Noel, you might as well just use a bank if you are going to have to query a bunch of values with constants.

This is a bit better. The tEngineNode class has to reference the subclass in order to access its parameters:
Type tEngineNode
Field target:tEngineNode
Field vehicle:tVehicle
Field player:tPlayer
EndType

Type tPlayer Extends tEngineNode
	Method New()
		player=Self
	EndMethod
EndType

Type tVehicle Extends tEngineNode
	Field speed#=100
	Method New()
		vehicle=Self
	EndMethod
EndType

player:tplayer=New tplayer
vehicle:tvehicle=New tvehicle
player.target=vehicle
Notify player.target.vehicle.speed