Class: TwistyPuzzles::MaybeFatMaybeSliceMove
- Inherits:
-
CubeMove
- Object
- AbstractMove
- AxisFaceAndDirectionMove
- CubeMove
- TwistyPuzzles::MaybeFatMaybeSliceMove
- Defined in:
- lib/twisty_puzzles/cube_move.rb
Overview
Not that this represents a move that is written as āuā which is a slice move on bigger cubes but a fat move on 3x3ā¦
Constant Summary
Constants inherited from AbstractMove
AbstractMove::AXES, AbstractMove::MOVE_METRICS, AbstractMove::SLICE_FACES, AbstractMove::SLICE_NAMES
Instance Attribute Summary
Attributes inherited from AxisFaceAndDirectionMove
Instance Method Summary collapse
-
#decide_meaning(cube_size) ⇒ Object
We handle the annoying inconsistency that u is a slice move for bigger cubes, but a fat move for 3x3.
- #to_s ⇒ Object
Methods inherited from CubeMove
Methods inherited from AxisFaceAndDirectionMove
#can_swap?, #canonical_direction, #identifying_fields, #initialize, #mirror, #rotate_by, #same_axis?, #swap_internal, #translated_direction
Methods inherited from AbstractMove
#<=>, #can_swap?, check_move_metric, #direction, #eql?, #equivalent?, #equivalent_internal?, #hash, #identifying_fields, #identity?, #inverse, #join_with_cancellation, #mirror, #move_count, #prepend_inner_m_slice_move, #prepend_slice_move, #puzzles, #rotate_by, #slice_move?, #swap, #swap_internal
Methods included from Utils::ArrayHelper
#apply_permutation, #check_types, #find_only, #only, #replace_once, #rotate_out_nils, #turned_equals?
Methods included from Utils::StringHelper
#camel_case_to_snake_case, #format_time, #simple_class_name, #snake_case_class_name
Constructor Details
This class inherits a constructor from TwistyPuzzles::AxisFaceAndDirectionMove
Instance Method Details
#decide_meaning(cube_size) ⇒ Object
We handle the annoying inconsistency that u is a slice move for bigger cubes, but a fat move for 3x3.
367 368 369 370 371 372 373 |
# File 'lib/twisty_puzzles/cube_move.rb', line 367 def decide_meaning(cube_size) case cube_size when 2 then raise ArgumentError when 3 then FatMove.new(@axis_face, @direction, 2) else SliceMove.new(@axis_face, @direction, 1) end end |
#to_s ⇒ Object
375 376 377 |
# File 'lib/twisty_puzzles/cube_move.rb', line 375 def to_s "#{@axis_face.name.downcase}#{@direction.name}" end |