//virtual quint32 ScrollingLayoutRenderer::scrollAmountUntilTopOverscroll() { // qDebug() << "scroll v = " << scrollValue() << " , raw scroll v = " << rawScrollValue() << " , top lim = " << topLimit(); if (scrollValue() <= topLimit()) { return 0; //already in top overscroll } return (quint32)qAbs(scrollValue()); }
/*Add legal Moves for Pawn at Location to Linked List*/ void getPawnSingleMove(char board[BOARD_SIZE][BOARD_SIZE], Location *loc, ListNode *temp, Move *move){ int i; if (loc->row + shiftUp(board, loc) == topLimit(board, loc)){ for (i = 0; i < sizeof(PROMOTIONS) / sizeof(Type); i++){ Move *newMove = copyMove(move); newMove->promotion = PROMOTIONS[i]; addMoveToList(temp, newMove); } freeMove(move); } else{ addMoveToList(temp, move); } }
/*Determine distance from top-left of Board*/ int distFromUL(char board[BOARD_SIZE][BOARD_SIZE], Location *loc){ int up = abs(topLimit(board, loc) - loc->row); int left = abs(leftLimit(board, loc) - loc->column); return minimum(up, left); }
/*Determine distance from top-right of Board*/ int distFromUR(char board[BOARD_SIZE][BOARD_SIZE], Location *loc){ int up = abs(topLimit(board, loc) - loc->row); int right = abs(rightLimit(board, loc) - loc->column); return minimum(up, right); }
/*Determine distance from top of Board*/ int distFromU(char board[BOARD_SIZE][BOARD_SIZE], Location *loc){ int up = abs(topLimit(board, loc) - loc->row); return up; }