freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

課程設(shè)計(jì)報(bào)告-俄羅斯方塊-嵌入式-qt(編輯修改稿)

2024-08-29 22:09 本頁(yè)面
 

【文章內(nèi)容簡(jiǎn)介】 HTetrisPiece(){setShape(HTetrisPieceShapeNone)。} void setRandomShape()。 void setShape(HTetrisPieceShape shape)。 HTetrisPieceShape shape() const { return pieceShape。 } int x(int index) const { return coords[index][0]。 } int y(int index) const { return coords[index][1]。 } int minX() const。 int maxX() const。 int minY() const。 int maxY() const。 void setRotate(HTetrisPieceRotate rotate)。 HTetrisPiece pieceFromRotatedLeft() const。 HTetrisPiece pieceFromRotatedRight() const。private: void setX(int index, int x) { coords[index][0] = x。 } void setY(int index, int y) { coords[index][1] = y。 } HTetrisPieceShape pieceShape。 int coords[4][2]。}。endif // HTetrisPIECE_H/* *Filename: *Author: Hale Chan halechan@ *Date: 20111124 */include include QtCorestatic const int coordsTable[8][4][2] = { {{0, 0}, {0, 0}, {0, 0}, {0, 0}}, {{0, 1}, {0, 0}, {0, 1}, {0, 2}}, {{1, 0}, {0, 0}, {1, 0}, {0, 1}}, {{0, 1}, {0, 0}, {0, 1}, {1, 1}}, {{0, 1}, {0, 0}, {0, 1}, {1, 1}}, {{0, 0}, {1, 0}, {1, 1}, {0, 1}}, {{1, 1}, {0, 1}, {0, 0}, {1, 0}}, {{1, 1}, {0, 1}, {0, 0}, {1, 0}}}。void HTetrisPiece::setRandomShape(){ setShape((HTetrisPieceShape)(qrand() % 7 + 1))。}void HTetrisPiece::setShape(HTetrisPieceShape shape){ for (int i=0。 i4。 i++){ coords[i][0] = coordsTable[shape][i][0]。 coords[i][1] = coordsTable[shape][i][1]。 } pieceShape = shape。}int HTetrisPiece::minX()const{ int min = coords[0][0]。 for (int i = 1。 i 4。 ++i) min = qMin(min, coords[i][0])。 return min。}int HTetrisPiece::maxX()const{ int max = coords[0][0]。 for (int i = 1。 i 4。 ++i) max = qMax(max, coords[i][0])。 return max。}int HTetrisPiece::minY()const{ int min = coords[0][1]。 for (int i = 1。 i 4。 ++i) min = qMin(min, coords[i][1])。 return min。}int HTetrisPiece::maxY()const{ int max = coords[0][1]。 for (int i = 1。 i 4。 ++i) max = qMax(max, coords[i][1])。 return max。}void HTetrisPiece::setRotate(HTetrisPieceRotate rotate){ switch(rotate){ case HTetrisPieceRotate90: for(int i=0。 i4。 i++){ int tmp = x(i)。 setX(i,y(i))。 setY(i, tmp)。 } break。 case HTetrisPieceRotate180: for(int i=0。 i4。 i++){ setX(i,x(i))。 setY(i, y(i))。 } break。 case HTetrisPieceRotate270: for(int i=0。 i4。 i++){ int tmp = x(i)。 setX(i,y(i))。 setY(i, tmp)。 } break。 default: break。 }}HTetrisPiece HTetrisPiece::pieceFromRotatedLeft()const{ if (pieceShape == HTetrisPieceShapeO) return *this。 HTetrisPiece result。 = pieceShape。 for (int i = 0。 i 4。 ++i) { (i, y(i))。 (i, x(i))。 } return result。}HTetrisPiece HTetrisPiece::pieceFromRotatedRight()const{ if (pieceShape == HTetrisPieceShapeO) return *this。 HTetrisPiece result。 = pieceShape。 for (int i = 0。 i 4。 ++i) { (i, y(i))。 (i, x(i))。 } return result。}/* *Filename: *Author: Hale Chan halechan@ *Date: 20111124 */ifndef HTetrisBOARD_Hdefine HTetrisBOARD_Hinclude QBasicTimerinclude QFrameinclude QPointerinclude class QLabel。define HTetrisBoardWidth 10define HTetrisBoardHeight 20class HTetrisBoard : public QFrame{ Q_OBJECTpublic: HTetrisBoard(QWidget *parent = 0)。 void setNextPieceLabel(QLabel *label)。 QSize sizeHint() const。 QSize minimumSizeHint() const。public slots: void start()。 void pause()。 void moveRight()。 void moveLeft()。 void moveDown()。 void rotateRight()。 void rotateLeft()。signals: void scoreChanged(int score)。 void levelChanged(int level)。protected: void paintEvent(QPaintEvent *event)。 void keyPressEvent(QKeyEvent *event)。 void timerEvent(QTimerEvent *event)。private: HTetrisPieceShape amp。shapeAt(int x, int y) { return board[(y * HTetrisBoardWidth) + x]。 } int timeoutTime() { return 1000 / level。 } int squareWidth() { return contentsRect().width() / HTetrisBoardWidth。 } int squareHeight() { return contentsRect().height() / HTetrisBoardHeight。 }
點(diǎn)擊復(fù)制文檔內(nèi)容
公司管理相關(guān)推薦
文庫(kù)吧 www.dybbs8.com
備案圖片鄂ICP備17016276號(hào)-1