Class: TwistyPuzzles::SkewbDirection

Inherits:
AbstractDirection show all
Defined in:
lib/twisty_puzzles/skewb_direction.rb

Overview

Represents the direction of a Skewb move except a rotation.

Constant Summary collapse

NUM_DIRECTIONS =
3
NON_ZERO_DIRECTIONS =
(1...NUM_DIRECTIONS).map { |d| new(d) }.freeze
ALL_DIRECTIONS =
Array.new(NUM_DIRECTIONS) { |d| new(d) }.freeze
ZERO =
new(0)
FORWARD =
new(1)
BACKWARD =
new(2)

Constants inherited from AbstractDirection

AbstractDirection::POSSIBLE_DIRECTION_NAMES, AbstractDirection::POSSIBLE_SKEWB_DIRECTION_NAMES, AbstractDirection::SIMPLE_DIRECTION_NAMES, AbstractDirection::SIMPLE_SKEWB_DIRECTION_NAMES

Instance Attribute Summary

Attributes inherited from AbstractDirection

#value

Instance Method Summary collapse

Methods inherited from AbstractDirection

#+, #<=>, #eql?, #hash, #initialize, #inverse, #non_zero?, #zero?

Constructor Details

This class inherits a constructor from TwistyPuzzles::AbstractDirection

Instance Method Details

#double_move?Boolean

Returns:

  • (Boolean)


19
20
21
# File 'lib/twisty_puzzles/skewb_direction.rb', line 19

def double_move?
  false
end

#nameObject



15
16
17
# File 'lib/twisty_puzzles/skewb_direction.rb', line 15

def name
  SIMPLE_SKEWB_DIRECTION_NAMES[@value]
end