Changeset View
Changeset View
Standalone View
Standalone View
KBlocksSingleGame.h
| 1 | /*************************************************************************** | 1 | /*************************************************************************** | ||
|---|---|---|---|---|---|
| 2 | * KBlocks, a falling blocks game by KDE * | 2 | * KBlocks, a falling blocks game by KDE * | ||
| 3 | * Copyright (C) 2010 Zhongjie Cai <squall.leonhart.cai@gmail.com> * | 3 | * Copyright (C) 2010 Zhongjie Cai <squall.leonhart.cai@gmail.com> * | ||
| 4 | * * | 4 | * * | ||
| 5 | * This program is free software; you can redistribute it and/or modify * | 5 | * This program is free software; you can redistribute it and/or modify * | ||
| 6 | * it under the terms of the GNU General Public License as published by * | 6 | * it under the terms of the GNU General Public License as published by * | ||
| 7 | * the Free Software Foundation; either version 2 of the License, or * | 7 | * the Free Software Foundation; either version 2 of the License, or * | ||
| 8 | * (at your option) any later version. * | 8 | * (at your option) any later version. * | ||
| 9 | ***************************************************************************/ | 9 | ***************************************************************************/ | ||
| 10 | #ifndef KBLOCKSSINGLEGAME_H | 10 | #ifndef KBLOCKSSINGLEGAME_H | ||
| 11 | #define KBLOCKSSINGLEGAME_H | 11 | #define KBLOCKSSINGLEGAME_H | ||
| 12 | 12 | | |||
| 13 | #include <sys/time.h> | | |||
| 14 | #include <QObject> | 13 | #include <QObject> | ||
| 15 | 14 | | |||
| 16 | #include "SingleGameInterface.h" | 15 | #include "SingleGameInterface.h" | ||
| 17 | 16 | | |||
| 18 | #include "KBlocksField.h" | 17 | #include "KBlocksField.h" | ||
| 19 | #include "KBlocksPiece.h" | 18 | #include "KBlocksPiece.h" | ||
| 20 | #include "KBlocksPieceGenerator.h" | 19 | #include "KBlocksPieceGenerator.h" | ||
| 21 | #include "KBlocksGameMessage.h" | 20 | #include "KBlocksGameMessage.h" | ||
| ▲ Show 20 Lines • Show All 44 Lines • ▼ Show 20 Line(s) | |||||
| 66 | private: | 65 | private: | ||
| 67 | int doUpdateGame(bool force); | 66 | int doUpdateGame(bool force); | ||
| 68 | bool runGameOneStep(int *gameResult); | 67 | bool runGameOneStep(int *gameResult); | ||
| 69 | bool checkPieceTouchGround(KBlocksPiece *p); | 68 | bool checkPieceTouchGround(KBlocksPiece *p); | ||
| 70 | void freezePieceToField(KBlocksPiece *p); | 69 | void freezePieceToField(KBlocksPiece *p); | ||
| 71 | int removeFieldLines(); | 70 | int removeFieldLines(); | ||
| 72 | void prepareNextPiece(); | 71 | void prepareNextPiece(); | ||
| 73 | 72 | | |||
| 74 | timeLong getMillisecOfNow(); | | |||
| 75 | | ||||
| 76 | protected: | 73 | protected: | ||
| 77 | KBlocksField *mpField = nullptr; | 74 | KBlocksField *mpField = nullptr; | ||
| 78 | 75 | | |||
| 79 | int mPieceCount; | 76 | int mPieceCount; | ||
| 80 | KBlocksPiece **mpPieceList = nullptr; | 77 | KBlocksPiece **mpPieceList = nullptr; | ||
| 81 | 78 | | |||
| 82 | private: | 79 | private: | ||
| 83 | KBlocksPieceGenerator *mpPieceGenerator = nullptr; | 80 | KBlocksPieceGenerator *mpPieceGenerator = nullptr; | ||
| Show All 14 Lines | |||||