Class: RSokoban::LevelSet
- Inherits:
-
Object
- Object
- RSokoban::LevelSet
- Defined in:
- lib/rsokoban/level_set.rb
Overview
I am a set of sokoban levels. Level set are found in .xsb files.
xsb file format
Info lines begins with semi-colon (;) Map lines begins with a # (that’s a wall !) preceded by 0, 1 or more spaces.
-
First info is title of the set
-
Blank line
-
List of info lines : description
-
Blank line
-
Level map
-
info title of this level
-
List of info lines : blabla about this level
From 4 to 7 again for each supplementary level
Instance Attribute Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ LevelSet
constructor
A new instance of LevelSet.
- #size ⇒ Object
Constructor Details
#initialize ⇒ LevelSet
Returns a new instance of LevelSet.
29 30 31 32 33 |
# File 'lib/rsokoban/level_set.rb', line 29 def initialize @title = 'Unknown set title' @description = 'Empty description' @raw_levels = [] end |
Instance Attribute Details
#description ⇒ Object
25 26 27 |
# File 'lib/rsokoban/level_set.rb', line 25 def description @description end |
#raw_levels ⇒ Object
27 28 29 |
# File 'lib/rsokoban/level_set.rb', line 27 def raw_levels @raw_levels end |
#title ⇒ Object
23 24 25 |
# File 'lib/rsokoban/level_set.rb', line 23 def title @title end |
Instance Method Details
#size ⇒ Object
35 36 37 |
# File 'lib/rsokoban/level_set.rb', line 35 def size @raw_levels.size end |