public virtual void DoShift() { if (shifting == 0) { return; } if (shiftall) { if (isShown) { PD.sounds.SetSoundAndPlay(SoundPaths.S_ShiftRows); } if (shifting > 0) { cursor.shiftX((cursor.getX() == width - 1) ? (-width + 1) : 1); cursor.DoUpdate(); for (int i = 0; i < height; i++) { ShiftRow(i, 1); changes.Add(new MirrorChangeShift(i, 1)); } } else if (shifting < 0) { cursor.shiftX((cursor.getX() == 0) ? (width - 1) : -1); cursor.DoUpdate(); for (int i = 0; i < height; i++) { ShiftRow(i, -1); changes.Add(new MirrorChangeShift(i, -1)); } } } else { if (isShown) { PD.sounds.SetSoundAndPlay(SoundPaths.S_ShiftRow); } if (shifting > 0) { ShiftRow(cursor.getY(), 1); changes.Add(new MirrorChangeShift(cursor.getY(), 1)); } else if (shifting < 0) { ShiftRow(cursor.getY(), -1); changes.Add(new MirrorChangeShift(cursor.getY(), -1)); } } actionDelay = PD.KEY_DELAY; }
private void UpdateCursors() { depthPenetrateKill t1 = GetDepthAndKillForDisplay(cursor1, board1, board2); cursor1.SetDepthAndKillForDisplay(t1.depth, t1.penetrate, t1.penetratedepth, t1.kill); depthPenetrateKill t2 = GetDepthAndKillForDisplay(cursor2, board2, board1); cursor2.SetDepthAndKillForDisplay(t2.depth, t2.penetrate, t2.penetratedepth, t2.kill); cursor1.DoUpdate(board1.GetHighestRowWithTiles()); cursor2.DoUpdate(board2.GetHighestRowWithTiles()); }