Planet
navi homePPSaboutscreenshotsdownloaddevelopmentforum

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

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

updated some files so NewScriptController lua binds are created. added DebugTask to cmake.

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