Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/campaignHS15/src/orxonox/controllers/MasterController.h @ 10955

Last change on this file since 10955 was 10955, checked in by gania, 9 years ago

cleaned up a bit

File size: 2.5 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 *      Gani Aliguzhinov
24 *   Co-authors:
25 *      ...
26 *
27 */
28
29#ifndef _MasterController_H__
30#define _MasterController_H__
31
32#include "controllers/FightingController.h"
33#include "tools/interfaces/Tickable.h"
34
35
36
37namespace orxonox
38{
39    /**
40    @brief
41      calles action(), maneuver() and canFire() methods of all the ActionpointControllers in level.
42      Only one instance of MasterController is to be placed in level.
43      If no MasterController is initialized, none of ActionpointControllers will work.
44      Example:
45      <Pawn position = "100000, 100000, 100000">
46        <controller>
47          <MasterController>
48          </MasterController>
49        </controller>
50      </Pawn>
51    */
52    class _OrxonoxExport MasterController : public FightingController, public Tickable
53    {
54        public:
55            //----[language demanded functions]----           
56                MasterController(Context* context);
57
58                virtual ~MasterController();
59            //----[/language demanded functions]----           
60
61            //----[orxonox demanded functions]----
62                virtual void tick(float dt); 
63
64            //----[orxonox demanded functions]----
65
66        protected:
67         
68        private:
69            std::vector<WeakPtr<FightingController> > controllers_;  //<! vector of controllers, which action(), canFire() and maneuver() methods are to be called
70            size_t indexOfCurrentController_;                        //<! index of current controller
71            unsigned int numberOfTicksPassedSinceLastActionCall_;
72            unsigned int ticks_;                                     //<! local tick counter           
73
74    };
75}
76
77#endif /* _MasterController_H__ */
Note: See TracBrowser for help on using the repository browser.