Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/sagerjFS16/src/modules/overlays/hud/HUDChargeBar.h @ 11634

Last change on this file since 11634 was 11189, checked in by sagerj, 8 years ago

done/fixed everything, weaponmode/discharger fully commented only hudchargebar left

File size: 2.1 KB
Line 
1
2/*
3 *   ORXONOX - the hottest 3D action shooter ever to exist
4 *                    > www.orxonox.net <
5 *
6 *
7 *   License notice:
8 *
9 *   This program is free software; you can redistribute it and/or
10 *   modify it under the terms of the GNU General Public License
11 *   as published by the Free Software Foundation; either version 2
12 *   of the License, or (at your option) any later version.
13 *
14 *   This program is distributed in the hope that it will be useful,
15 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
16 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17 *   GNU General Public License for more details.
18 *
19 *   You should have received a copy of the GNU General Public License
20 *   along with this program; if not, write to the Free Software
21 *   Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
22 *
23 *   Author:
24 *      Johannes Sager
25 *   Co-authors:
26 *      ...
27 *
28 */
29
30#ifndef _HUDChargeBar_H__
31#define _HUDChargeBar_H__
32
33#include "overlays/OverlaysPrereqs.h"
34#include "util/Math.h"
35#include "tools/interfaces/Tickable.h"
36#include "overlays/OverlayText.h"
37#include "HUDBar.h"
38
39#include "weaponsystem/WeaponSystem.h"
40#include "weaponsystem/WeaponPack.h"
41#include "weaponsystem/WeaponMode.h"
42#include "weaponsystem/Weapon.h"
43
44namespace orxonox
45{
46    /**
47    @brief
48        The HUDChargeBar displays the amount of charges of its owner (a @ref Pawn).
49        The length of the bar is given by the ratio of the current charges and the maximal charges of the @ref Pawn.
50    */
51
52    class _OverlaysExport HUDChargeBar : public HUDBar, public Tickable
53    {
54        public:
55            HUDChargeBar(Context* context);
56            virtual ~HUDChargeBar();
57
58            virtual void tick(float dt) override;
59            virtual void changedOwner() override;
60
61            inline void setHealthBarOwner(Pawn* owner)
62                { this->owner_ = owner; }
63       
64        private:
65            WeaponMode* correspondingMode_;         // pointer on the chargeable weaponmode (=nullptr if no chargeable weapons equipped)
66            WeakPtr<Pawn> owner_;
67    };
68}
69#endif /* _HUDChargeBar_H__ */
Note: See TracBrowser for help on using the repository browser.