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 | #ifndef _LeaderController_H__ |
---|
30 | #define _LeaderController_H__ |
---|
31 | |
---|
32 | #include "SectionController.h" |
---|
33 | |
---|
34 | |
---|
35 | namespace orxonox |
---|
36 | { |
---|
37 | class _OrxonoxExport LeaderController : public SectionController, public Tickable |
---|
38 | { |
---|
39 | public: |
---|
40 | |
---|
41 | LeaderController(Context* context); |
---|
42 | virtual ~LeaderController(); |
---|
43 | |
---|
44 | virtual void tick(float dt); //<! Carrying out the targets set in action(). |
---|
45 | |
---|
46 | protected: |
---|
47 | |
---|
48 | enum Mode {KEEPFORMATION, ROCKET, KILLENEMY}; |
---|
49 | Mode mode_; |
---|
50 | |
---|
51 | virtual void action(); //<! action() is called in regular intervals managing the bot's behaviour ~ setting targets. |
---|
52 | //void defaultBehaviour(float maxrand); //<! Helper function for code reusage. Some concrete commands for a bot. |
---|
53 | |
---|
54 | |
---|
55 | //WEAPONSYSTEM DATA |
---|
56 | std::map<std::string, int> weaponModes_; //<! Links each "weapon" to it's weaponmode - managed by setupWeapons() |
---|
57 | //std::vector<int> projectiles_; //<! Displays amount of projectiles of each weapon. - managed by setupWeapons() |
---|
58 | float timeout_; //<! Timeout for rocket usage. (If a rocket misses, a bot should stop using it.) |
---|
59 | void setupWeapons(); //<! Defines which weapons are available for a bot. Is recalled whenever a bot was killed. |
---|
60 | bool bSetupWorked; //<! If false, setupWeapons() is called. |
---|
61 | int getFiremode(std::string name); |
---|
62 | |
---|
63 | void boostControl(); //<! Sets and resets the boost parameter of the spaceship. Bots alternate between boosting and saving boost. |
---|
64 | |
---|
65 | private: |
---|
66 | static const float ACTION_INTERVAL; |
---|
67 | |
---|
68 | Timer actionTimer_; //<! Regularly calls action(). |
---|
69 | |
---|
70 | }; |
---|
71 | } |
---|
72 | |
---|
73 | #endif /* _LeaderController_H__ */ |
---|