1 /* 2 Bastet - tetris clone with embedded bastard block chooser 3 (c) 2005-2009 Federico Poloni <f.polonithirtyseven@sns.it> minus 37 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 3 of the License, or 8 (at your option) any later version. 9 10 This program is distributed in the hope that it will be useful, 11 but WITHOUT ANY WARRANTY; without even the implied warranty of 12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 13 GNU General Public License for more details. 14 15 You should have received a copy of the GNU General Public License 16 along with this program. If not, see <http://www.gnu.org/licenses/>. 17 */ 18 19 #ifndef BLOCKCHOOSER_HPP 20 #define BLOCKCHOOSER_HPP 21 22 #include "Block.hpp" 23 #include <deque> 24 25 namespace Bastet{ 26 27 class Well; 28 //queue of blocks to appear on the screen 29 typedef std::deque<BlockType> Queue; 30 31 ///Abstract class to represent a block choosing algorithm 32 class BlockChooser{ 33 public: 34 BlockChooser(); 35 virtual ~BlockChooser(); 36 virtual Queue GetStartingQueue()=0; //chooses first blocks after a game starts 37 virtual BlockType GetNext(const Well *well, const Queue &q)=0; //chooses next block 38 private: 39 }; 40 41 ///the usual Tetris random block chooser, for testing purposes 42 class RandomBlockChooser: public BlockChooser{ 43 public: 44 RandomBlockChooser(); 45 virtual ~RandomBlockChooser(); 46 virtual Queue GetStartingQueue(); 47 virtual BlockType GetNext(const Well *well, const Queue &q); 48 private: 49 }; 50 51 } 52 53 #endif //BLOCKCHOOSER_HPP 54