Changeset 10052 for code/branches/modularships/src/orxonox/items
- Timestamp:
- May 8, 2014, 4:20:26 PM (11 years ago)
- Location:
- code/branches/modularships/src/orxonox/items
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/modularships/src/orxonox/items/CMakeLists.txt
r10019 r10052 4 4 MultiStateEngine.cc 5 5 ShipPart.cc 6 PartDestructionEvent.cc 6 7 ) -
code/branches/modularships/src/orxonox/items/ShipPart.cc
r10033 r10052 40 40 #include "gametypes/Gametype.h" 41 41 #include "worldentities/StaticEntity.h" 42 #include "items/PartDestructionEvent.h" 42 43 43 44 … … 66 67 67 68 XMLPortParam(ShipPart, "damageabsorption", setDamageAbsorption, getDamageAbsorption, xmlelement, mode).defaultValues(0.5); 69 70 XMLPortObject(ShipPart, PartDestructionEvent, "destructionevents", addDestructionEvent, getDestructionEvent, xmlelement, mode); 68 71 69 72 /* … … 142 145 orxout() << " " << this->entityList_[j]->getName() << endl; 143 146 } 147 } 148 149 /** 150 @brief 151 Add a PartDestructionEvent to the ShipPart. 152 @param engine 153 A pointer to the PartDestructionEvent to be added. 154 */ 155 void ShipPart::addDestructionEvent(PartDestructionEvent* part) 156 { 157 OrxAssert(part != NULL, "The PartDestructionEvent cannot be NULL."); 158 this->eventList_.push_back(part); 159 //part->setParent(this); 160 } 161 162 /** 163 @brief 164 Get the i-th PartDestructionEvent of the ShipPart. 165 @return 166 Returns a pointer to the i-the PartDestructionEvent. NULL if there is no PartDestructionEvent with that index. 167 */ 168 PartDestructionEvent* ShipPart::getDestructionEvent(unsigned int index) 169 { 170 if(this->eventList_.size() >= index) 171 return NULL; 172 else 173 return this->eventList_[index]; 144 174 } 145 175 -
code/branches/modularships/src/orxonox/items/ShipPart.h
r10023 r10052 32 32 #include "OrxonoxPrereqs.h" 33 33 #include "Item.h" 34 #include "items/PartDestructionEvent.h" 34 35 35 36 #include <string> … … 58 59 StaticEntity* getEntity(unsigned int index); 59 60 bool hasEntity(StaticEntity* entity) const; 61 62 void addDestructionEvent(PartDestructionEvent* event); 63 PartDestructionEvent* getDestructionEvent(unsigned int index); 60 64 61 65 void printEntities(); // FIXME: (noep) remove debug … … 102 106 private: 103 107 std::vector<StaticEntity*> entityList_; // list of all entities which belong to this part 108 std::vector<PartDestructionEvent*> eventList_; // The list of all PartDestructionEvent assigned to this ShipPart. 109 104 110 105 111 }; // tolua_export
Note: See TracChangeset
for help on using the changeset viewer.