Super placed in def dispose?

Started by Apidcloud, April 01, 2011, 10:02:24 am

Previous topic - Next topic

Apidcloud

April 01, 2011, 10:02:24 am Last Edit: April 01, 2011, 10:07:39 am by Apidcloud
Hey there again :P

Blizzard already explained me the use of supers, but I've one doubt or two xD

On the dispose method, should I do as in initialize one?
I mean, if I use 'super()' at initialize method , then at dispose method should I put 'super()' or just 'super' ?

Same question when I need to put arguments on the super...

class xxx < YYY
 def initialize
    super(d, d, d)
    #code
 def dispose
    self.contents.clear
    super(d, d, d)
 end
end


My other doubt, was about the 'order' or the code at dispose method...
On the previous case I used 'self.contents.clear' first, but it is the correct order? What should I write first, and what are the differences between the different orders? :P



Appreciated (:
Instead of wanting to be somebody else, rather become somebody else



"I will treasure the knowledge like a squirrel treasures acorns."


Gibbo Glast 2D Engine - The sky is no longer a limit

ForeverZer0

The () are only used if the method of the super has arguments. If it doesn't have arguments, which most dispose methods won't, you casn omit the ().
I am done scripting for RMXP. I will likely not offer support for even my own scripts anymore, but feel free to ask on the forum, there are plenty of other talented scripters that can help you.

Apidcloud

Then even If super has arguments, at def dispose I can omit them?
Instead of wanting to be somebody else, rather become somebody else



"I will treasure the knowledge like a squirrel treasures acorns."


Gibbo Glast 2D Engine - The sky is no longer a limit

Blizzard

Check out Daygames and our games:

King of Booze 2      King of Booze: Never Ever
Drinking Game for Android      Never have I ever for Android
Drinking Game for iOS      Never have I ever for iOS


Quote from: winkioI do not speak to bricks, either as individuals or in wall form.

Quote from: Barney StinsonWhen I get sad, I stop being sad and be awesome instead. True story.

Apidcloud

Instead of wanting to be somebody else, rather become somebody else



"I will treasure the knowledge like a squirrel treasures acorns."


Gibbo Glast 2D Engine - The sky is no longer a limit