[10097] | 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 Mini4DgameCenterpoint.h |
---|
| 31 | @brief Declaration of the Mini4DgameCenterpoint class. |
---|
| 32 | */ |
---|
| 33 | |
---|
| 34 | #ifndef _Mini4DgameCenterpoint_H__ |
---|
| 35 | #define _Mini4DgameCenterpoint_H__ |
---|
| 36 | |
---|
| 37 | #include <string> |
---|
| 38 | |
---|
| 39 | #include <util/Math.h> |
---|
| 40 | |
---|
| 41 | #include "worldentities/StaticEntity.h" |
---|
[10101] | 42 | #include "mini4Dgame/Mini4DgamePrereqs.h" |
---|
[10131] | 43 | //#include "mini4Dgame/Mini4Dgame.h" |
---|
[10097] | 44 | |
---|
| 45 | namespace orxonox |
---|
| 46 | { |
---|
| 47 | /** |
---|
| 48 | @brief |
---|
| 49 | The Mini4DgameCenterpoint implements the playing field @ref orxonox::Mini4Dgame "Mini4Dgame" takes place in and allows for many parameters of the minigame to be set. |
---|
| 50 | |
---|
| 51 | */ |
---|
[10101] | 52 | class _Mini4DgameExport Mini4DgameCenterpoint : public StaticEntity |
---|
[10097] | 53 | { |
---|
| 54 | public: |
---|
| 55 | Mini4DgameCenterpoint(Context* context); //!< Constructor. Registers and initializes the object and checks whether the gametype is actually Mini4Dgame. |
---|
| 56 | virtual ~Mini4DgameCenterpoint() {} |
---|
| 57 | |
---|
| 58 | virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode); //!< Method to create a Mini4DgameCenterpoint through XML. |
---|
| 59 | |
---|
| 60 | virtual void changedGametype(); //!< Is called when the gametype has changed. |
---|
| 61 | |
---|
| 62 | /** |
---|
[10131] | 63 | @brief Get the template of the board. |
---|
| 64 | @return Returns the name of the template of the board. |
---|
[10097] | 65 | */ |
---|
[10131] | 66 | const std::string& getBoardtemplate() const |
---|
| 67 | { return this->boardtemplate_; } |
---|
[10097] | 68 | |
---|
[10131] | 69 | |
---|
[10097] | 70 | /** |
---|
[10131] | 71 | @brief Set the template for the board. |
---|
| 72 | @param boardtemplate The name of the template to be set. |
---|
[10097] | 73 | */ |
---|
[10131] | 74 | void setBoardtemplate(const std::string& boardtemplate) |
---|
| 75 | { this->boardtemplate_ = boardtemplate; } |
---|
[10097] | 76 | |
---|
| 77 | |
---|
| 78 | /** |
---|
| 79 | @brief Set the dimensions of the playing field. |
---|
| 80 | @param dimension A vector with the width of the playing field as first component, the height as second and the length as third. |
---|
| 81 | */ |
---|
| 82 | void setFieldDimension(const Vector3& dimension) |
---|
| 83 | { this->width_ = dimension.x; this->height_ = dimension.y; this->length_ = dimension.z;} |
---|
| 84 | /** |
---|
| 85 | @brief Get the dimensions of the playing field. |
---|
| 86 | @return Returns a vector with the width of the playing field as first component, the height as second and the length as third. |
---|
| 87 | */ |
---|
| 88 | Vector3 getFieldDimension() const |
---|
| 89 | { return Vector3(this->width_, this->height_, this->length_); } |
---|
| 90 | |
---|
| 91 | private: |
---|
| 92 | void checkGametype(); //!< Checks whether the gametype is Mini4Dgame and if it is, sets its centerpoint. |
---|
| 93 | |
---|
[10131] | 94 | std::string boardtemplate_; //!< The template for the board. |
---|
[10097] | 95 | |
---|
| 96 | float width_; //!< The height of the playing field. |
---|
| 97 | float height_; //!< The width of the playing field. |
---|
| 98 | float length_; //!< The length of the playing field. |
---|
| 99 | }; |
---|
| 100 | } |
---|
| 101 | |
---|
| 102 | #endif /* _Mini4DgameCenterpoint_H__ */ |
---|