[10721] | 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 | * Fabien Vultier |
---|
| 24 | * Co-authors: |
---|
| 25 | * ... |
---|
| 26 | * |
---|
| 27 | */ |
---|
| 28 | |
---|
| 29 | /** |
---|
| 30 | @file MunitionContainer.h |
---|
| 31 | @brief Declaration of the MunitionContainer class. |
---|
| 32 | @ingroup PickupItems |
---|
| 33 | */ |
---|
| 34 | |
---|
| 35 | #ifndef _MunitionContainer_H__ |
---|
| 36 | #define _MunitionContainer_H__ |
---|
| 37 | |
---|
| 38 | #include "pickup/PickupPrereqs.h" |
---|
| 39 | |
---|
| 40 | #include <string> |
---|
| 41 | |
---|
| 42 | #include "pickup/Pickup.h" |
---|
| 43 | #include "core/class/SubclassIdentifier.h" |
---|
| 44 | #include "weaponsystem/Munition.h" |
---|
| 45 | |
---|
| 46 | namespace orxonox |
---|
| 47 | { |
---|
| 48 | class _PickupExport MunitionContainer : public BaseObject |
---|
| 49 | { |
---|
| 50 | public: |
---|
| 51 | |
---|
| 52 | MunitionContainer(Context* context); |
---|
| 53 | virtual ~MunitionContainer(); |
---|
| 54 | |
---|
[11071] | 55 | virtual void XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode) override; |
---|
[10721] | 56 | |
---|
| 57 | inline const std::string& getMunitionName() const |
---|
| 58 | { return this->munitionName_; } |
---|
| 59 | inline int getMunitionAmount() const |
---|
| 60 | { return this->munitionAmount_; } |
---|
| 61 | inline int getMagazinesAmount() const |
---|
| 62 | { return this->magazinesAmount_; } |
---|
| 63 | inline SubclassIdentifier<Munition> getMunitionType() const |
---|
| 64 | { return munitionType_; } |
---|
| 65 | |
---|
| 66 | protected: |
---|
| 67 | void setMunitionName(const std::string& munitionName); |
---|
| 68 | void setMunitionAmount(int munitionAmount); |
---|
| 69 | void setMagazinesAmount(int magazinesAmount_); |
---|
| 70 | |
---|
| 71 | private: |
---|
| 72 | SubclassIdentifier<Munition> munitionType_; //!< Indentifier of the munition type. |
---|
| 73 | std::string munitionName_; //!< String containing the class name of the munition type (e.g. "LaserMunition") |
---|
| 74 | int munitionAmount_; //!< The amount of singe bullets added |
---|
| 75 | int magazinesAmount_; //!< The amount of full magazines added |
---|
| 76 | |
---|
| 77 | }; |
---|
| 78 | } |
---|
| 79 | |
---|
| 80 | #endif // _MunitionContainer_H__ |
---|