Class: Cliptic::Main::Windows::Grid
- Inherits:
-
Windows::Grid
- Object
- Curses::Window
- Windows::Window
- Windows::Grid
- Cliptic::Main::Windows::Grid
- Defined in:
- lib/cliptic/main.rb
Constant Summary
Constants included from Chars
Chars::Block, Chars::HL, Chars::LL, Chars::LS, Chars::LU, Chars::MS, Chars::Nums, Chars::RL, Chars::RS, Chars::RU, Chars::TD, Chars::TL, Chars::TR, Chars::TU, Chars::Tick, Chars::VL, Chars::XX
Instance Attribute Summary collapse
-
#blocks ⇒ Object
readonly
Returns the value of attribute blocks.
-
#indices ⇒ Object
readonly
Returns the value of attribute indices.
Attributes inherited from Windows::Grid
Attributes inherited from Windows::Window
#centered_x, #centered_y, #col, #line, #x, #y
Instance Method Summary collapse
- #cell(y:, x:) ⇒ Object
- #draw ⇒ Object
-
#initialize(puzzle:) ⇒ Grid
constructor
A new instance of Grid.
Methods inherited from Windows::Grid
Methods inherited from Windows::Window
#add_str, #bold, #clear, #color, #move, #refresh, #reset_attrs, #reset_pos, #setpos, #standend, #standout, #time_str, #wrap_str
Methods included from Chars
Constructor Details
#initialize(puzzle:) ⇒ Grid
Returns a new instance of Grid.
32 33 34 35 36 |
# File 'lib/cliptic/main.rb', line 32 def initialize(puzzle:) super(**puzzle.size, line:1) @indices,@blocks = puzzle.indices,puzzle.blocks link_cells_to_clues(clues:puzzle.clues) end |
Instance Attribute Details
#blocks ⇒ Object (readonly)
Returns the value of attribute blocks.
31 32 33 |
# File 'lib/cliptic/main.rb', line 31 def blocks @blocks end |
#indices ⇒ Object (readonly)
Returns the value of attribute indices.
31 32 33 |
# File 'lib/cliptic/main.rb', line 31 def indices @indices end |
Instance Method Details
#cell(y:, x:) ⇒ Object
42 43 44 |
# File 'lib/cliptic/main.rb', line 42 def cell(y:, x:) cells[y][x] end |
#draw ⇒ Object
37 38 39 40 41 |
# File 'lib/cliptic/main.rb', line 37 def draw super add_indices add_blocks end |