OOP question

BlitzMax Forums/BlitzMax Programming/OOP question

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.

hey every one, just a quick thing.

I made a Type for invisibility. It was coded a year ago so at the time i thought it was the best way to work. so for invisibility to work obviously i have to instance an object on that type and use its methods on an object i want invisible.

I have realised while doing AI this method won't be suitable. So ive moved all the methods of that type to my players ship type. The type which i Base the player ship off of, which is extended by an enemyship type for enemy ships.

So am I correct that by using SELF while programming the AI functions/routines/methods that I can get any object of the current type once the condition has been reached, to invoke the said invisible methods on the object that called it?

so say ship A is damaged and wants to go invisible, the code to go invsisible will only work on Ship A because his condition is met and only the instance of Ship A uses the code because I use self in the routine to go invisible, which by using SELF it provides a way for a method to refer to the instance of the type that called the method.