Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/trunk/src/modules/overlays/hud/HUDEnemyHealthBar.h @ 9189

Last change on this file since 9189 was 9016, checked in by jo, 13 years ago

Merging presentation2011 branch to trunk. Please check for possible bugs.

File size: 2.6 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 *      Matthias Spalinger
24 *   Co-authors:
25 *      ...
26 *
27 */
28
29#ifndef _HUDEnemyHealthBar_H__
30#define _HUDEnemyHealthBar_H__
31
32#include "interfaces/RadarViewable.h"
33#include "worldentities/pawns/Pawn.h"
34
35#include "HUDHealthBar.h"
36#include "interfaces/RadarListener.h"
37
38namespace orxonox
39{
40    class _OverlaysExport HUDEnemyHealthBar : public HUDHealthBar, public RadarListener
41    {
42        public:
43            HUDEnemyHealthBar(BaseObject* creator);
44            virtual ~HUDEnemyHealthBar();
45            void setConfigValues();
46
47            bool compareDistance ( std::pair<RadarViewable*, unsigned int > a, std::pair<RadarViewable*, unsigned int > b );
48
49            virtual void XMLPort(Element& xmlelement, XMLPort::Mode mode);
50            virtual void tick(float dt);
51
52            //RadarListener interface
53            void addObject ( RadarViewable* object );
54            void removeObject ( RadarViewable* viewable );
55            void objectChanged(RadarViewable* viewable);
56            virtual void radarTick ( float dt ) {}
57            inline float getRadarSensitivity() const
58                { return 1.0f; }
59
60            void changedOwner();
61
62        private:
63
64            void setSensibility (float sense){
65                this->sens_ = sense;}
66            float getSensibility(){
67                return this->sens_;}
68
69            bool showObject(RadarViewable* rv);
70       
71            typedef std::list < std::pair<RadarViewable*, unsigned int > > sortedList;
72            sortedList sortedObjectList_;
73
74            Pawn* owner_;
75            float sens_;
76            bool useEnemyBar_;
77            unsigned int markerLimit_;
78
79            float currentYaw;
80            float currentPitch;
81    };
82}
83#endif /* _HUDEnemyHealthBar_H__ */
Note: See TracBrowser for help on using the repository browser.