I thought I knew OOP, oops.

BlitzMax Forums/BlitzMax Programming/I thought I knew OOP, oops.

Old-ish thread, but anywho, your best option is to do something like this:

Type ICloneable
     '' Virtual method
     Method Clone:ICloneable( )
          Throw "Object cannot be cloned"
     End Method
End Type

Type WeebleBobble Extends ICloneable
     Field A:Int
     Field B:Foobar '' also implements ICloneable

     Method Clone:ICloneable( into:ICloneable )
          Local i:WeebleBobble = WeebleBobble( into )
          If ( i = Null )
               i = new WeebleBobble
          EndIf
          i.A = A
          i.B = B.Clone( )
'' Now, if this class wasn't directly below ICloneable you would do this
''          Super.Clone( i )
          Return i
     End Method
End Type