You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Not sure if you're still actively developing, but if you are, then you might consider sub-classing Console and get the root_console as a separate class. It'll allow you to get rid of having that third parameter in the constructor while still being able to pass rootconsoles everywhere you pass regular consoles. It seems more rubyesque to do it that way.
Here's an example from my port:
moduleRogueclassRootConsole < Consoledefinitialze(width,height)ifwidth < 0failArgumentError,"width must be non-negative, was #{width}"elsifheight < 0failArgumentError,"width must be non-negative, was #{width}"end@width=width@height=height@clear_cell=Console.clear_cell@out_of_bounds_cell=Console.out_of_bounds_cell@ptr=nilObjectSpace.define_finalizer(self,self.class.finalize(@ptr))enddefself.instance@instance ||= create_instanceenddefself.create_instanceunlessRogue::System.initialized?error_message="Rogue::System.initialize has not been called yet."failerror_messageendRootConsole.new(System.SCREEN_WIDTH,System.SCREEN_HEIGHT)endprivate_class_method:create_instanceendend
The text was updated successfully, but these errors were encountered:
Not sure if you're still actively developing, but if you are, then you might consider sub-classing Console and get the root_console as a separate class. It'll allow you to get rid of having that third parameter in the constructor while still being able to pass rootconsoles everywhere you pass regular consoles. It seems more rubyesque to do it that way.
Here's an example from my port:
The text was updated successfully, but these errors were encountered: