- Timestamp:
- May 14, 2014, 8:25:08 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/modularships/src/orxonox/items/PartDestructionEvent.h
r10053 r10055 38 38 namespace orxonox // tolua_export 39 39 { // tolua_export 40 /** 41 @brief 42 In order to assign attached entities to a ShipPart, a ShipPart with the same name as the corresponding entity needs to be created in the <parts> tag. 43 Here is a (primitive) example of a ModularSpaceShip with ShipParts and PartDestructionEvents defined in XML: 44 @code 45 <ModularSpaceShip 46 ... 47 > 48 <attached> 49 <StaticEntity name="generator" . . . /> 50 <StaticEntity name="tail" . . . /> 51 </attached> 52 <parts> 53 <ShipPart name="generator" . . . > 54 <destructionevents> 55 <PartDestructionEvent targetType="ship" targetParam="boostpowerrate" operation="-" value="0.5" message="Your boost-regeneration is reduced!" /> 56 </destructionevents> 57 </ShipPart> 58 <ShipPart name="tail" . . . > 59 <destructionevents> 60 <PartDestructionEvent ... /> 61 </destructionevents> 62 </ShipPart> 63 </parts> 64 <engines> 65 <Engine /> 66 <Engine /> 67 </engines> 68 </ModularSpaceShip> 69 @endcode 70 71 @author 72 Fabian 'x3n' Landau, Noe Pedrazzini 73 */ 40 74 class _OrxonoxExport PartDestructionEvent // tolua_export 41 75 : public Item … … 44 78 public: 45 79 80 /** 81 @brief 82 List of all allowed parameters. 83 */ 46 84 enum TargetParam 47 85 { … … 50 88 shieldabsorption, 51 89 shieldrechargerate, 90 boostpower, // Amount of available boost 91 boostpowerrate, // Recharge-rate of boost 92 boostfactor, 93 speedfront, 94 accelerationfront, 52 95 null 53 96 }; … … 85 128 { return this->operation_; } 86 129 130 void setMessage(std::string msg); 131 inline std::string getMessage() 132 { return this->message_; } 133 87 134 float operate(float input); 88 135 … … 95 142 private: 96 143 97 ShipPart* parent_; 98 bool valid_; 144 ShipPart* parent_; //!< Pointer to the ShipPart this event belongs to 145 bool valid_; //!< Whether this event is valid or not. 99 146 100 std::string targetType_; 101 std::string targetName_; 102 TargetParam targetParam_; 103 std::string operation_; 147 std::string targetType_; //!< The type of the target. (ship weapon engine) 148 std::string targetName_; //!< The name of the target. 149 TargetParam targetParam_; //!< The parameter to be modified 150 std::string operation_; //!< The operation to be applied 151 float value_; //!< The value used to do the operation 152 std::string message_; //!< The message which is shown in chat when the event is executed. 104 153 105 float value_;106 154 107 155
Note: See TracChangeset
for help on using the changeset viewer.