1 | /*************************************************************************** |
2 | * KBlocks, a falling blocks game for KDE * |
3 | * Copyright (C) 2010 Zhongjie Cai <squall.leonhart.cai@gmail.com> * |
4 | * * |
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 * |
7 | * the Free Software Foundation; either version 2 of the License, or * |
8 | * (at your option) any later version. * |
9 | ***************************************************************************/ |
10 | #ifndef KBLOCKSPIECEGENERATOR_H |
11 | #define KBLOCKSPIECEGENERATOR_H |
12 | |
13 | class KBlocksPieceGenerator |
14 | { |
15 | public: |
16 | KBlocksPieceGenerator(int size = 4096); |
17 | ~KBlocksPieceGenerator(); |
18 | |
19 | public: |
20 | void genList(int seed); |
21 | int getPiece(); |
22 | int getIndex(); |
23 | |
24 | private: |
25 | int maxCapacity; |
26 | int pieceIndex; |
27 | int* maPieceList; |
28 | }; |
29 | |
30 | #endif |
31 | |
32 | |