Class: TwistyPuzzles::MaybeFatMSliceMaybeInnerMSliceMove

Inherits:
CubeMove show all
Includes:
MSlicePrintHelper
Defined in:
lib/twisty_puzzles/cube_move.rb

Overview

An M slice move for which we don’t know yet whether it’s an inner or fat M slice move.

Constant Summary

Constants inherited from AbstractMove

AbstractMove::AXES, AbstractMove::MOVE_METRICS, AbstractMove::SLICE_FACES, AbstractMove::SLICE_NAMES

Instance Attribute Summary

Attributes inherited from AxisFaceAndDirectionMove

#axis_face, #direction

Instance Method Summary collapse

Methods included from MSlicePrintHelper

#to_s

Methods inherited from CubeMove

#puzzles

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

For even layered cubes, m slice moves are meant as very fat moves where only the outer layers stay. For odd layered cubes, we only move the very middle.



83
84
85
86
87
88
89
# File 'lib/twisty_puzzles/cube_move.rb', line 83

def decide_meaning(cube_size)
  if cube_size.even?
    FatMSliceMove.new(@axis_face, @direction)
  else
    InnerMSliceMove.new(@axis_face, @direction, cube_size / 2)
  end
end