Class: TwistyPuzzles::TCenter

Inherits:
MoveableCenter show all
Defined in:
lib/twisty_puzzles/cube.rb

Overview

Represents one T center or the position of one T center on the cube.

Constant Summary collapse

CORRESPONDING_PART_CLASS =
Edge
ELEMENTS =
generate_parts

Constants inherited from MoveableCenter

MoveableCenter::FACES

Constants included from CubeConstants

CubeConstants::ALPHABET_SIZE, CubeConstants::CHIRALITY_FACE_SYMBOLS, CubeConstants::FACE_NAMES, CubeConstants::FACE_SYMBOLS, CubeConstants::OPPOSITE_FACE_SYMBOLS, CubeConstants::SKEWB_STICKERS

Instance Attribute Summary

Attributes inherited from MoveableCenter

#corresponding_part

Attributes inherited from Part

#face_symbols, #piece_index

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from MoveableCenter

#eql?, #face_symbol, for_face_symbols, generate_parts, #initialize, #inspect, max_parseable_face_symbols, min_parseable_face_symbols, #neighbor?, #neighbors, #rotate_by, valid?

Methods inherited from Part

#<=>, #base_index_on_face, #corresponding_part, #eql?, exists_on_cube_size?, exists_on_odd_cube_sizes?, #faces, for_face_symbols, for_face_symbols_internal, for_index, generate_parts, #hash, #initialize, #inspect, max_cube_size, max_parseable_face_symbols, min_parseable_face_symbols, #mirror, parse, #rotate_by, #rotate_by_rotation, #rotate_face_symbol_up, #rotate_face_up, #rotations, #solved_coordinate, #solved_face, #to_s, #turned_equals?, valid?

Methods included from Utils::ArrayHelper

#apply_permutation, #check_types, #find_only, #only, #replace_once, #rotate_out_nils, #turned_equals?

Methods included from CubeConstants

#chirality_canonical_face_symbol, #opposite_face_symbol, #valid_chirality?

Constructor Details

This class inherits a constructor from TwistyPuzzles::MoveableCenter

Class Method Details

.exists_on_even_cube_sizes?Boolean

Returns:

  • (Boolean)


691
692
693
# File 'lib/twisty_puzzles/cube.rb', line 691

def self.exists_on_even_cube_sizes?
  false
end

.min_cube_sizeObject



687
688
689
# File 'lib/twisty_puzzles/cube.rb', line 687

def self.min_cube_size
  5
end

Instance Method Details

#base_index_on_other_face(_face, cube_size, incarnation_index) ⇒ Object

One index of such a piece on a on a NxN face.



704
705
706
# File 'lib/twisty_puzzles/cube.rb', line 704

def base_index_on_other_face(_face, cube_size, incarnation_index)
  [1 + incarnation_index, cube_size / 2]
end

#num_incarnations(cube_size) ⇒ Object



695
696
697
698
699
700
701
# File 'lib/twisty_puzzles/cube.rb', line 695

def num_incarnations(cube_size)
  if cube_size.even? || cube_size <= 3
    0
  else
    (cube_size / 2) - 1
  end
end