Changeset 11673 for code/branches/ScriptableController_HS17/src/orxonox/scriptablecontroller/scriptable_controller_api.h
- Timestamp:
- Dec 14, 2017, 4:04:14 PM (7 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
code/branches/ScriptableController_HS17/src/orxonox/scriptablecontroller/scriptable_controller_api.h
r11662 r11673 146 146 * @param type Name of the class of the object you want to spawn 147 147 * @param id The newly created ID that can be used to access this object 148 * 149 * IMPORTANT: Do not use this function yet, it only has minimal functionality and is not 150 * really helpful as it is. 148 151 */ 149 152 void spawn(std::string type, std::string id); … … 196 199 197 200 private: 198 /**199 * @brief Called by ScriptableController when a pawn is killed200 * @param id The dead pawn201 *202 * Calls the lua callbacks associated with this event.203 */204 void pawnKilled(std::string id, Pawn *pawn);205 206 /**207 * @brief Called by ScriptableController when a Pawn is hit208 * @param target_id The hit Pawn209 * @param source_id The shooting Pawn210 * @param new_health The new health of the hit Pawn211 * @param new_shield The new shield health of the hit Pawn212 */213 void pawnHit(std::string target_id, std::string source_id, double new_health, double new_shield);214 215 201 /** 216 202 * @brief Groups everything together that is needed to handle a near-object event … … 260 246 }; 261 247 262 263 248 lua_State *lua_; 264 249 ScriptableController *controller_; … … 266 251 std::list<NearPointHandler> nearPointHandlers_; 267 252 std::list<AreaHandler> areaHandlers_; 268 std::list<std::string> pawnsToKill_;269 253 std::map<std::string, std::list<std::function<void (std::string)> > > pawnDestroyedHandlers_; 270 254 std::map<std::string, std::list<std::function<void (std::string, std::string, double, double)> > > pawnHitHandlers_; … … 273 257 274 258 /** 259 * @brief Called by ScriptableController when a pawn is killed 260 * @param id The dead pawn 261 * 262 * Calls the lua callbacks associated with this event. 263 */ 264 void pawnKilled(std::string id, Pawn *pawn); 265 266 /** 267 * @brief Called by ScriptableController when a Pawn is hit 268 * @param target_id The hit Pawn 269 * @param source_id The shooting Pawn 270 * @param new_health The new health of the hit Pawn 271 * @param new_shield The new shield health of the hit Pawn 272 */ 273 void pawnHit(std::string target_id, std::string source_id, double new_health, double new_shield); 274 275 /** 275 276 * @brief Called every 0.5s 276 277 * 277 * This handles things that have to be checked periodically (like area events) and 278 * things that are done by lua that have to synchronize with the main thread (like 279 * killing a pawn). Doing this in every tick would be an overkill. 278 * This handles things that have to be checked periodically (like area events) 279 * but doing this in every tick would be an overkill. 280 280 */ 281 281 void periodic(void);
Note: See TracChangeset
for help on using the changeset viewer.