Class: ConsoleShogi::Terminal::DisplayArea
- Inherits:
-
Object
- Object
- ConsoleShogi::Terminal::DisplayArea
show all
- Defined in:
- lib/console_shogi/terminal/display_area.rb
Defined Under Namespace
Modules: Komadai
Classes: Board, History, Infomation, Others, Position
Constant Summary
collapse
- OTHERS =
:others
- BOARD =
:board
- SENTE_KOMADAI =
:sente_komadai
- GOTE_KOMADAI =
:gote_komadai
Class Method Summary
collapse
Class Method Details
.board? ⇒ Boolean
32
33
34
|
# File 'lib/console_shogi/terminal/display_area.rb', line 32
def board?
Board == self
end
|
.end_position ⇒ Object
24
25
26
|
# File 'lib/console_shogi/terminal/display_area.rb', line 24
def end_position
self::END_POSITION
end
|
.fetch_area(x:, y:) ⇒ Object
.in?(x:, y:) ⇒ Boolean
48
49
50
51
|
# File 'lib/console_shogi/terminal/display_area.rb', line 48
def in?(x:, y:)
Range.new(start_position.x, end_position.x).include?(x) &&
Range.new(start_position.y, end_position.y).include?(y)
end
|
.komadai? ⇒ Boolean
36
37
38
|
# File 'lib/console_shogi/terminal/display_area.rb', line 36
def komadai?
[Komadai::Gote, Komadai::Sente].include?(self)
end
|
.name ⇒ Object
28
29
30
|
# File 'lib/console_shogi/terminal/display_area.rb', line 28
def name
self::NAME
end
|
.start_position ⇒ Object
20
21
22
|
# File 'lib/console_shogi/terminal/display_area.rb', line 20
def start_position
self::START_POSITION
end
|