Class: Pitchcar::Pieces::StraightLeftWall

Inherits:
Straight show all
Defined in:
lib/pieces/straight_left_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_left_wall.rb', line 4

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

#to_sObject



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

def to_s
  'Slw'
end