File indexing completed on 2024-04-21 04:02:08

0001 /***************************************************************************
0002 *   KBlocks, a falling blocks game by KDE                                *
0003 *   SPDX-FileCopyrightText: 2010 Zhongjie Cai <squall.leonhart.cai@gmail.com>       *
0004 *                                                                         *
0005 *   SPDX-License-Identifier: GPL-2.0-or-later
0006 ***************************************************************************/
0007 #ifndef KBLOCKSPIECEGENERATOR_H
0008 #define KBLOCKSPIECEGENERATOR_H
0009 
0010 class KBlocksPieceGenerator
0011 {
0012 public:
0013     explicit KBlocksPieceGenerator(int size = 4096);
0014     ~KBlocksPieceGenerator();
0015 
0016 public:
0017     void genList(int seed);
0018     int getPiece();
0019     int getIndex();
0020 
0021 private:
0022     int  maxCapacity;
0023     int  pieceIndex;
0024     int *maPieceList = nullptr;
0025 };
0026 
0027 #endif
0028