Class: Pitchcar::Pieces::StraightRightWall

Inherits:
Straight show all
Defined in:
lib/pieces/straight_right_wall.rb

Constant Summary

Constants inherited from Straight

Pitchcar::Pieces::Straight::IMAGE

Constants inherited from Piece

Piece::DIRECTIONS

Instance Attribute Summary

Attributes inherited from Piece

#direction, #type, #x, #y

Instance Method Summary collapse

Methods inherited from Straight

#next_coordinate, #next_direction

Methods inherited from Piece

#coordinate, first_from_string, #initialize, #name, #to_h, type_from_string

Constructor Details

This class inherits a constructor from Pitchcar::Pieces::Piece

Instance Method Details

#imageObject



4
5
6
7
8
9
10
11
12
13
14
# File 'lib/pieces/straight_right_wall.rb', line 4

def image
  if south?
    IMAGE.rotate(90)
  elsif west?
    IMAGE.rotate(180)
  elsif east?
    IMAGE
  elsif north?
    IMAGE.rotate(270)
  end
end

#to_sObject



16
17
18
# File 'lib/pieces/straight_right_wall.rb', line 16

def to_s
  'Srw'
end