Changeset 9857 for code/branches/spacestationentry/src/modules/docking
- Timestamp:
- Dec 2, 2013, 4:05:10 PM (11 years ago)
- Location:
- code/branches/spacestationentry/src/modules/docking
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/spacestationentry/src/modules/docking/Dock.cc
r9820 r9857 69 69 XMLPortObject(Dock, DockingAnimation, "animations", addAnimation, getAnimation, xmlelement, mode); 70 70 XMLPortEventSink(Dock, BaseObject, "execute", execute, xmlelement, mode); 71 //XMLPortEventSink(Dock, BaseObject, "undocking", undocking, xmlelement, mode);71 XMLPortEventSink(Dock, BaseObject, "undocking", undocking, xmlelement, mode); 72 72 73 73 } … … 79 79 XMLPortEventSink(Dock, BaseObject, "execute", execute, xmlelement, mode); 80 80 81 //XMLPortEventSink(Dock, BaseObject, "undocking", undocking, xmlelement, mode);82 } 83 84 /* 81 XMLPortEventSink(Dock, BaseObject, "undocking", undocking, xmlelement, mode); 82 } 83 84 85 85 bool Dock::undocking(bool bTriggered, BaseObject* trigger) 86 86 { 87 orxout(user_warning)<<"undocking"<<endl; 88 89 return true; 90 } 91 92 */ 87 // Noch lange nicht fertig (leich veraenderte Kopie von execute()) 88 PlayerTrigger* pTrigger = orxonox_cast<PlayerTrigger*>(trigger); 89 PlayerInfo* player = NULL; 90 91 // Check whether it is a player trigger and extract pawn from it 92 if(pTrigger != NULL) 93 { 94 if(!pTrigger->isForPlayer()) { // The PlayerTrigger is not exclusively for Pawns which means we cannot extract one. 95 orxout(verbose, context::docking) << "Docking:execute PlayerTrigger was not triggered by a player.." << endl; 96 return false; 97 } 98 player = pTrigger->getTriggeringPlayer(); 99 } 100 else 101 { 102 orxout(verbose, context::docking) << "Docking::execute Not a player trigger, can't extract pawn from it.." << endl; 103 return false; 104 } 105 if(player == NULL) 106 { 107 orxout(verbose, context::docking) << "Docking::execute Can't retrieve PlayerInfo from Trigger. (" << trigger->getIdentifier()->getName() << ")" << endl; 108 return false; 109 } 110 111 if(bTriggered) 112 { 113 cmdUndock(); 114 } 115 else 116 { 117 // Remove player from candidates list 118 candidates_.erase(player); 119 } 120 121 return true; 122 } 123 124 93 125 94 126 bool Dock::execute(bool bTriggered, BaseObject* trigger) -
code/branches/spacestationentry/src/modules/docking/Dock.h
r9820 r9857 62 62 // Trigger interface 63 63 bool execute(bool bTriggered, BaseObject* trigger); 64 //bool undocking(bool bTriggered, BaseObject* trigger);64 bool undocking(bool bTriggered, BaseObject* trigger); 65 65 66 66 // XML interface
Note: See TracChangeset
for help on using the changeset viewer.