Question about Types and Fields

BlitzMax Forums/BlitzMax Beginners Area/Question about Types and Fields

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.

It's like Honda_2 is an "Instance" of Honda_1, rather than just a copy.
Yes. Objects are "Passed by reference" (think of it as two references, sharing the object in question between them).

In order to "copy" or "clone" an object you could have a clone method, and use it like this:
Type Car
	Field Color:String

	Method deepClone:Car()
		Local temp:Car = New car
		temp.Color = Color
		Return temp
	End Method
End Type


Honda_1:Car = New Car

Honda_1.Color = "Red"

Honda_2:Car = Honda_1.deepClone()

Honda_1.Color = "Blue"

Print Honda_1.Color
Print Honda_2.Color