Module: RSokoban::GameGUI

Includes:
Game
Included in:
GameTk
Defined in:
lib/rsokoban/game/game_gui.rb

Overview

I extends/implements the API of module Game, to run the game within a GUI. I don’t define the user interface, you can use me to run game with Tk, Gnome, etc.

Since:

  • 0.74.1

Instance Attribute Summary collapse

Attributes included from Game

#level_number, #set_name

Instance Method Summary collapse

Methods included from Game

#level_height, #level_title, #level_width, #load_a_new_set, #load_level, #man_x, #man_y, #map_as_array, #move, #move_number, #next_level, #record, #redo, #restart_set, #set_size, #set_title, #undo, #update_record

Instance Attribute Details

#ui=(value) ⇒ Object (writeonly)

Since:

  • 0.74.1



10
11
12
# File 'lib/rsokoban/game/game_gui.rb', line 10

def ui=(value)
  @ui = value
end

Instance Method Details

#initialize(ui, setname = 'microban.xsb') ⇒ Object

Since:

  • 0.74.1



12
13
14
# File 'lib/rsokoban/game/game_gui.rb', line 12

def initialize ui, setname = 'microban.xsb'
	super(ui, setname)
end

#runObject

Since:

  • 0.74.1



16
17
18
# File 'lib/rsokoban/game/game_gui.rb', line 16

def run
	@ui.run
end

#start_levelObject

Since:

  • 0.74.1



20
21
22
23
# File 'lib/rsokoban/game/game_gui.rb', line 20

def start_level
	@level = @level_loader.level(@level_number)
	nil
end