Changeset 8151
- Timestamp:
- Mar 28, 2011, 4:39:32 PM (14 years ago)
- Location:
- code/branches/dockingsystem
- Files:
-
- 4 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/dockingsystem/data/levels/docking.oxw
r8137 r8151 1 1 <LevelInfo 2 2 name = "Transporter" 3 description = "Level with moving Transporter."3 description = "Level with a Transporter. Demostrates the docking system." 4 4 tags = "" 5 5 /> … … 14 14 <Level 15 15 name = "Transporter" 16 description = " Level with Transporter :)"16 description = "Docking example level" 17 17 > 18 18 <templates> … … 48 48 49 49 <Dock> 50 <effects> 51 <DockToShip /> 52 </effects> 50 53 <events> 51 54 <execute> … … 54 57 </events> 55 58 <attached> 56 < PlayerTrigger name="dockMe" /> //A PlayerTrigger triggering the execution of the QuestEffectBeacon.59 <DistanceTrigger position="0,0,0" distance=2 target="ControllableEntity" name="dockMe" /> 57 60 </attached> 58 61 </Dock> -
code/branches/dockingsystem/src/modules/docking/CMakeLists.txt
r8137 r8151 1 1 SET_SOURCE_FILES(DOCKING_SRC_FILES 2 DockingEffect.cc 3 DockToShip.cc 2 4 Dock.cc 3 5 ) -
code/branches/dockingsystem/src/modules/docking/Dock.cc
r8140 r8151 38 38 { 39 39 40 41 40 CreateFactory(Dock); 42 41 … … 56 55 SUPER(Dock, XMLPort, xmlelement, mode); 57 56 58 // TODO: Something similar to XMLPortObject(Dock, QuestEffect, "effects", addEffect, getEffect, xmlelement, mode);57 XMLPortObject(Dock, DockingEffect, "effects", addEffect, getEffect, xmlelement, mode); 59 58 XMLPortEventSink(Dock, BaseObject, "execute", execute, xmlelement, mode); 60 59 … … 77 76 78 77 78 bool Dock::addEffect(DockingEffect* effect) { 79 assert(effect); 80 effects_.push_back(effect); 81 return true; 82 } 83 84 const DockingEffect* Dock::getEffect(unsigned int index) const { 85 int i = index; 86 for (std::list<DockingEffect*>::const_iterator effect = this->effects_.begin(); effect != this->effects_.end(); ++effect) 87 { 88 if(i == 0) 89 return *effect; 90 91 i--; 92 } 93 return NULL; 94 } 95 79 96 } -
code/branches/dockingsystem/src/modules/docking/Dock.h
r8140 r8151 41 41 42 42 #include "worldentities/StaticEntity.h" 43 #include "DockingEffect.h" 43 44 #include "DockingPrereqs.h" 44 45 … … 55 56 56 57 bool execute(bool bTriggered, BaseObject* trigger); 58 59 private: 60 std::list<DockingEffect*> effects_; //!< The list of DockingEffects to be executed when a player docks. 61 62 bool addEffect(DockingEffect* effect); //!< Add a DockingEffect to the Dock. 63 const DockingEffect* getEffect(unsigned int index) const; //!< Get the DockingEffect at a given index. 57 64 }; 58 65 -
code/branches/dockingsystem/src/modules/docking/DockingPrereqs.h
r8140 r8151 66 66 { 67 67 class Dock; 68 class DockingEffect; 68 69 } 69 70
Note: See TracChangeset
for help on using the changeset viewer.