| 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 Mini4DgameAI.h | 
|---|
| 31 | @brief Declaration of the Mini4DgameAI class. | 
|---|
| 32 | */ | 
|---|
| 33 |  | 
|---|
| 34 | #ifndef _Mini4DgameAI_H__ | 
|---|
| 35 | #define _Mini4DgameAI_H__ | 
|---|
| 36 |  | 
|---|
| 37 | #include "mini4dgame/Mini4DgamePrereqs.h" | 
|---|
| 38 |  | 
|---|
| 39 | #include <list> | 
|---|
| 40 |  | 
|---|
| 41 | #include "controllers/Controller.h" | 
|---|
| 42 | #include "Mini4DgameCenterpoint.h" | 
|---|
| 43 | #include "Mini4Dgame.h" | 
|---|
| 44 |  | 
|---|
| 45 | namespace orxonox | 
|---|
| 46 | { | 
|---|
| 47 |  | 
|---|
| 48 | /** | 
|---|
| 49 | @brief | 
|---|
| 50 | The Mini4DgameAI is an artificial intelligence for the @ref orxonox::Mini4Dgame "Mini4Dgame" gametype. | 
|---|
| 51 |  | 
|---|
| 52 | @author | 
|---|
| 53 | Oliver Richter | 
|---|
| 54 | */ | 
|---|
| 55 | class _Mini4DgameExport Mini4DgameAI : public Controller | 
|---|
| 56 | { | 
|---|
| 57 | public: | 
|---|
| 58 | Mini4DgameAI(Context* context); //!< Constructor. Registers and initializes the object. | 
|---|
| 59 | virtual ~Mini4DgameAI(); | 
|---|
| 60 |  | 
|---|
| 61 | //void setConfigValues(); | 
|---|
| 62 |  | 
|---|
| 63 | /** | 
|---|
| 64 | @brief | 
|---|
| 65 | starts the AI to make a move. implements the intelligence of the AI | 
|---|
| 66 | @param timeout | 
|---|
| 67 | The time the AI has to decide on a move. (Sets the strength of the AI) | 
|---|
| 68 | @return move | 
|---|
| 69 | The move that the AI decided to make. | 
|---|
| 70 | */ | 
|---|
| 71 | Vector4 makeMove(float timeout); | 
|---|
| 72 |  | 
|---|
| 73 | void setCenterpoint(Mini4DgameCenterpoint* center) | 
|---|
| 74 | { this->center_ = center; } | 
|---|
| 75 |  | 
|---|
| 76 | protected: | 
|---|
| 77 |  | 
|---|
| 78 | std::list<std::pair<Timer*, char>> reactionTimers_; //!< A list of reaction timers and the directions that take effect when their timer expires. | 
|---|
| 79 | Mini4DgameCenterpoint* center_; | 
|---|
| 80 |  | 
|---|
| 81 | private: | 
|---|
| 82 |  | 
|---|
| 83 | std::list<Vector4> getPossibleMoves(); | 
|---|
| 84 | void copyBoard(); | 
|---|
| 85 | Mini4DgamePlayerColor board_[4][4][4][4]; | 
|---|
| 86 | }; | 
|---|
| 87 | } | 
|---|
| 88 |  | 
|---|
| 89 | #endif /* _Mini4DgameAI_H__ */ | 
|---|