Last change
on this file since 10009 was
10009,
checked in by mkronig, 11 years ago
|
edited comments in levelTry.oxw file and scriptableController_00.cc
|
File size:
1.1 KB
|
Rev | Line | |
---|
[10006] | 1 | /* |
---|
[10009] | 2 | First try of a scriptController. Target: An event occurs in the levelTry.oxw file, which is "heard" by an object of the type of this class. It then SHOULD (because it is not working) execute the party function. |
---|
[10006] | 3 | */ |
---|
| 4 | |
---|
| 5 | #include "ScriptController_00.h" |
---|
| 6 | #include "core/CoreIncludes.h" |
---|
| 7 | |
---|
| 8 | namespace orxonox |
---|
| 9 | { |
---|
| 10 | RegisterClass(ScriptController_00); |
---|
| 11 | |
---|
| 12 | ScriptController_00::ScriptController_00(Context* context) : ArtificialController(context) |
---|
| 13 | { |
---|
[10009] | 14 | //Working |
---|
[10006] | 15 | RegisterObject(ScriptController_00); |
---|
| 16 | orxout()<<"hello universe constructor"<< endl; |
---|
| 17 | } |
---|
| 18 | |
---|
| 19 | bool ScriptController_00::party(bool bTriggered, BaseObject* trigger) |
---|
| 20 | { |
---|
[10009] | 21 | //XMLPortEventSink seems not to execute the party function |
---|
[10006] | 22 | orxout()<<"hello universe party"<< endl; |
---|
| 23 | return true; |
---|
| 24 | } |
---|
| 25 | |
---|
| 26 | |
---|
| 27 | void ScriptController_00::XMLPort(Element& xmlelement, XMLPort::Mode mode) |
---|
| 28 | { |
---|
| 29 | SUPER(ScriptController_00, XMLPort, xmlelement, mode); |
---|
[10009] | 30 | |
---|
| 31 | //WORKING |
---|
[10006] | 32 | XMLPortEventSink(ScriptController_00, BaseObject, "party", party, xmlelement, mode); |
---|
| 33 | orxout()<<"hello universe xmlport"<< endl; |
---|
| 34 | } |
---|
| 35 | |
---|
| 36 | |
---|
| 37 | |
---|
| 38 | |
---|
| 39 | } |
---|
Note: See
TracBrowser
for help on using the repository browser.