public Cube ApplyMoveSequence(StickerMoveGroup moveSequence) { var child = Clone(); moveSequence.Advance(_stickers, child._stickers); return(child); }
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 })); } }
public StickerMoveGroup GetMoveSequence() { return(StickerMoveGroup.CalculateMultiMoveSequence(_turns.Select(turn => turn.GetMoveSequence()))); }