Ejemplo n.º 1
0
        public Cube ApplyMoveSequence(StickerMoveGroup moveSequence)
        {
            var child = Clone();

            moveSequence.Advance(_stickers, child._stickers);
            return(child);
        }
Ejemplo n.º 2
0
        static Dictionary <Side, StickerMoveGroup> _twiceTurnGroupCache;            // holds 6 CCW moves

        static Turn()
        {
            _clockwiseTurnGroupCache        = new Dictionary <Side, StickerMoveGroup>();
            _counterclockwiseTurnGroupCache = new Dictionary <Side, StickerMoveGroup>();
            _twiceTurnGroupCache            = new Dictionary <Side, StickerMoveGroup>();
            foreach (var side in CubeGeometry.AllSides)
            {
                var sequence = new ClockwiseSequenceGroup(side);
                _clockwiseTurnGroupCache.Add(side, sequence);
                _counterclockwiseTurnGroupCache.Add(side, sequence.Reverse());
                _twiceTurnGroupCache.Add(side, StickerMoveGroup.CalculateMultiMoveSequence(new[] { sequence, sequence }));
            }
        }
Ejemplo n.º 3
0
 public StickerMoveGroup GetMoveSequence()
 {
     return(StickerMoveGroup.CalculateMultiMoveSequence(_turns.Select(turn => turn.GetMoveSequence())));
 }