OO Programming

BlitzMax Forums/BlitzMax Beginners Area/OO Programming

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.

@Duck they'll still be a purpose. For an automation updater system i'm going to make. You just has the 2dPoint and have an array of functions that requires 2dPoint and makes ArrayI[] and ArrayF#[] optional. The object(2DPointAutomator) will have a 1D array for procedures and a 2D array for args. THe first dimension is for creating a parallel with the currenct Procedure and the second array is for the passed functions args.

Function ShakeXY( 2Dpoint, I[]=Null, F[]=Null ) 'Sees if I  or F is not null then uses it for calcs. 
Functoin ShiftXY( 2Dpoint, I[]=Null, F[]=Null )

2dAutomator.SetPoint( Camera.pivot.p )
                        ' FunctPoint, I[], F[] 
2dAutomator.AddProcedure( ShakeXY, [-2,2,-2,2], Null )
2dAutomator.AddProcedure( ShiftXY, [1,2], Null )
'Some where else code where it is Always called

2dAutomator.Update()

Method UPdate()
For I = 0 to funProcedure.length - 1
    funProcedure[i](2DPoint, I[I][], F[I][] )
Next
End MEthod


That's just the rough idea of the system..there's alot more control..auto killing and such. But i'm just showing you why something like that could be useful.