Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

source: code/branches/plehmannFS16/src/orxonox/controllers/NewScriptController.h @ 11167

Last change on this file since 11167 was 11167, checked in by plehmann, 8 years ago

changed the NewScriptController and Task classes

File size: 2.7 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 *      Paul Lehmann
24 *   Co-authors:
25 *      ...
26 *
27 */
28
29#ifndef _NewScriptController_H__
30#define _NewScriptController_H__
31
32#include "Task.h"
33#include "OrxonoxPrereqs.h"                 /* die ganzen tolua, kopiert aus Dock.h*/
34#include "ArtificialController.h"
35#include "core/EventIncludes.h"
36
37
38
39namespace orxonox  // tolua_export
40{  // tolua_export
41
42
43
44    class _OrxonoxExport NewScriptController // tolua_export
45       : public ArtificialController, public Tickable
46    {  // tolua_export
47        public:
48            NewScriptController(Context* context);
49            virtual ~NewScriptController() { }
50
51            void takeControl(int ctrlid);
52            void setPlayer(PlayerInfo* player) { this->player_ = player; }
53           
54            virtual void tick(float dt) override;
55
56            // LUA interface
57            // tolua_begin
58
59            void debugOut();
60
61            static NewScriptController* getNewScriptController();
62
63            int getID() { return ctrlid_; }
64
65            //tolua_end
66
67            void createAndAddTask(Task newTask);
68
69        private:
70            // Information about the player that this ScriptController will
71            // control
72            // - Player pointer
73            PlayerInfo* player_;
74
75            // - Entity pointer, this is for convenience and will be the same as
76            //   player_->getControllableEntity()
77            ControllableEntity* entity_;
78
79            // Controller ID, defaults to 0 and is set using takeControl()
80            int ctrlid_;
81
82            // List of events to walk through
83            std::queue<Task>* taskList_;
84
85
86            //List of Tasks currently active
87            std::vector<Task>* activeTasks_;
88
89            // Time since the creation of this ScriptController object
90            float scTime_; 
91
92
93    };// tolua_export
94} // tolua_export
95
96#endif /* _NewScriptController_H__ */
Note: See TracBrowser for help on using the repository browser.