File indexing completed on 2022-11-23 10:43:24

0001 /*
0002     KBlackBox - A simple game inspired by an emacs module
0003 
0004     SPDX-FileCopyrightText: 2007 Nicolas Roffet <nicolas-kde@roffet.com>
0005 
0006     SPDX-License-Identifier: GPL-2.0-or-later
0007 */
0008 
0009 #ifndef KBBGRAPHICSITEMBALLREPOSITORY_H
0010 #define KBBGRAPHICSITEMBALLREPOSITORY_H
0011 
0012 #include "kbbgraphicsitem.h"
0013 class KBBGraphicsItemSet;
0014 class KBBScalableGraphicWidget;
0015 class KBBThemeManager;
0016 
0017 
0018 
0019 /**
0020  * @brief The balls the player has to place
0021  */
0022 class KBBGraphicsItemBallRepository : public KBBGraphicsItem
0023 {
0024     Q_OBJECT
0025 
0026 
0027     public:
0028         KBBGraphicsItemBallRepository(KBBScalableGraphicWidget* parent, KBBThemeManager* themeManager);
0029         ~KBBGraphicsItemBallRepository() override;
0030 
0031 
0032         int ballToTake() const;
0033         void fillBallsOutside(int placed);
0034         void newGame(int columns, int rows, int balls);
0035         void removeBall(int outsidePosition);
0036 
0037 
0038     private:
0039         KBBGraphicsItemSet* m_ballsOutside;
0040         KBBScalableGraphicWidget* m_parent;
0041         KBBThemeManager* m_themeManager;
0042 
0043         int m_columns;
0044         int m_rows;
0045         int m_width;
0046         int m_height;
0047         int m_ballToPlace;
0048 };
0049 
0050 #endif // KBBGRAPHICSITEMBALLREPOSITORY_H