Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/presentation2012/src/modules/pickup/items/FlagPickup.h @ 9241

Last change on this file since 9241 was 9241, checked in by decapitb, 12 years ago

tower defense update

File size: 3.0 KB
Line 
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 *      Nino Weingart
24 *   Co-authors:
25 *      ...
26 *
27 */
28
29/**
30 @file FlagPickup.h
31 @brief Declaration of the FlagPickup class.
32 @ingroup PickupItems
33 */
34
35#ifndef _FlagPickup_H__
36#define _FlagPickup_H__
37
38#include "pickup/PickupPrereqs.h"
39#include "worldentities/pawns/Pawn.h"
40
41#include <string>
42
43#include "pickup/Pickup.h"
44#include "tools/Timer.h"
45#include "tools/interfaces/Tickable.h"
46
47
48namespace orxonox {
49    /*
50     @ingroup PickupItems
51     
52     
53     @author
54     Nino Weingart
55     
56     @ingroup PickupItems
57     */
58    class _PickupExport FlagPickup : public Pickup, public Tickable
59    {
60    public:
61       
62        FlagPickup(BaseObject* creator); //!< Constructor.
63        ~FlagPickup(); //!< Destructor.
64       
65        virtual void XMLPort(Element& xmlelement, orxonox::XMLPort::Mode mode); //!< Method for creating a FlagPickup object through XML.
66       
67        virtual void tick(float dt);
68       
69            const int getFlagType(void) const; //!< Get the flag type of this pickup.
70           
71                inline bool isPickedUp() const
72        { return this->bPickedUp_; }
73                inline Pawn* pickedUpBy() const
74        { return this->pickedUpBy_; }
75       
76                inline void setPickedUp(bool pickedUp)
77                { this->bPickedUp_ = pickedUp; }
78               
79                inline void ignorePickedUp()
80                { this->Pickupable::destroy(); }
81       
82            virtual void changedUsed(void); //!< Is called when the pickup has transited from used to unused or the other way around.
83       
84    protected:
85        void initializeIdentifier(void); //!< Initializes the PickupIdentifier of this pickup.
86       
87        /**
88         @brief Set the flag type of this pickup.
89         @param type The type of this pickup as an enum.
90         */
91        inline void setFlagTypeDirect(int type)
92        { this->flagType_ = type; }
93       
94        void setFlagType(int type); //!< Set the type of the FlagPickup.
95       
96    private:
97        Pawn* carrierToPawnHelper(void); //!< Helper to transform the PickupCarrier to a Pawn, and throw an error message if the conversion fails.
98        void initialize(void); //!< Initializes the member variables.
99        Pawn* pickedUpBy_;
100        int flagType_;
101       
102        bool bPickedUp_;
103       
104    };
105}
106
107#endif // _FlagPickup_H__
Note: See TracBrowser for help on using the repository browser.