| 1 | /* | 
|---|
| 2 | *   ORXONOX - the hottest 3D action shooter ever to exist | 
|---|
| 3 | *                    > www.orxonox.net < | 
|---|
| 4 | * | 
|---|
| 5 | * | 
|---|
| 6 | *   License notice: | 
|---|
| 7 | * | 
|---|
| 8 | *   This program is free software; you can redistribute it and/or | 
|---|
| 9 | *   modify it under the terms of the GNU General Public License | 
|---|
| 10 | *   as published by the Free Software Foundation; either version 2 | 
|---|
| 11 | *   of the License, or (at your option) any later version. | 
|---|
| 12 | * | 
|---|
| 13 | *   This program is distributed in the hope that it will be useful, | 
|---|
| 14 | *   but WITHOUT ANY WARRANTY; without even the implied warranty of | 
|---|
| 15 | *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the | 
|---|
| 16 | *   GNU General Public License for more details. | 
|---|
| 17 | * | 
|---|
| 18 | *   You should have received a copy of the GNU General Public License | 
|---|
| 19 | *   along with this program; if not, write to the Free Software | 
|---|
| 20 | *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA. | 
|---|
| 21 | * | 
|---|
| 22 | *   Author: | 
|---|
| 23 | *      Fabian 'x3n' Landau | 
|---|
| 24 | *   Co-authors: | 
|---|
| 25 | *      ... | 
|---|
| 26 | * | 
|---|
| 27 | */ | 
|---|
| 28 |  | 
|---|
| 29 | /** | 
|---|
| 30 | @file Mini4DgameBoard.h | 
|---|
| 31 | @brief Declaration of the Mini4DgameBoard class. | 
|---|
| 32 | @ingroup Pong | 
|---|
| 33 | */ | 
|---|
| 34 |  | 
|---|
| 35 | #ifndef _Mini4DgameBoard_H__ | 
|---|
| 36 | #define _Mini4DgameBoard_H__ | 
|---|
| 37 |  | 
|---|
| 38 | #include "mini4dgame/Mini4DgamePrereqs.h" | 
|---|
| 39 |  | 
|---|
| 40 | #include "worldentities/StaticEntity.h" | 
|---|
| 41 |  | 
|---|
| 42 | namespace orxonox | 
|---|
| 43 | { | 
|---|
| 44 |  | 
|---|
| 45 | struct Mini4DgamePosition | 
|---|
| 46 | { | 
|---|
| 47 | Mini4DgamePosition(int x, int y, int z, int w) : x(x), y(y), z(z), w(w) {} | 
|---|
| 48 | int x; | 
|---|
| 49 | int y; | 
|---|
| 50 | int z; | 
|---|
| 51 | int w; | 
|---|
| 52 | }; | 
|---|
| 53 |  | 
|---|
| 54 | struct Mini4DgameWinner | 
|---|
| 55 | { | 
|---|
| 56 | int winningRow[4]; | 
|---|
| 57 | int winningColumn[4]; | 
|---|
| 58 | int winningHeight[4]; | 
|---|
| 59 | int winningNumber[4]; | 
|---|
| 60 | int color_; | 
|---|
| 61 | }; | 
|---|
| 62 |  | 
|---|
| 63 | /** | 
|---|
| 64 | @brief | 
|---|
| 65 | This class manages the board for @ref orxonox::Mini4Dgame "Mini4Dgame". | 
|---|
| 66 |  | 
|---|
| 67 | @author | 
|---|
| 68 | Oliver Richter | 
|---|
| 69 | */ | 
|---|
| 70 | class _Mini4DgameExport Mini4DgameBoard : public StaticEntity | 
|---|
| 71 | { | 
|---|
| 72 | public: | 
|---|
| 73 | Mini4DgameBoard(Context* context); | 
|---|
| 74 | //virtual ~Mini4DgameBoard(); | 
|---|
| 75 |  | 
|---|
| 76 | virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); | 
|---|
| 77 |  | 
|---|
| 78 | bool isValidMove(const Mini4DgamePosition& move); | 
|---|
| 79 | void undoMove(); | 
|---|
| 80 | void makeMove(const Mini4DgamePosition& move); | 
|---|
| 81 | Mini4DgameWinner getWinner(); | 
|---|
| 82 |  | 
|---|
| 83 | void changedGametype(); | 
|---|
| 84 | void checkGametype(); | 
|---|
| 85 |  | 
|---|
| 86 | private: | 
|---|
| 87 | //void registerVariables(); | 
|---|
| 88 | std::vector<Mini4DgamePosition> moves; | 
|---|
| 89 | bool player_toggle_; | 
|---|
| 90 | BlinkingBillboard* blinkingBillboards[4][4][4][4]; | 
|---|
| 91 | int board[4][4][4][4]; //!< The logical board where the game takes place. board[row][column][height][number] | 
|---|
| 92 | }; | 
|---|
| 93 | } | 
|---|
| 94 |  | 
|---|
| 95 | #endif /* _Mini4DgameBoard_H__ */ | 
|---|