From e55638d081e2e1ff6fbc06e0e8ac0381a04308e7 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Wed, 15 Sep 2010 21:29:18 +0000 Subject: updated comments, updated buy menu, info support for map window, added const to target selection --- src/core/entity.h | 43 ++++++++++++++++++++++++++++++------------- 1 file changed, 30 insertions(+), 13 deletions(-) (limited to 'src/core/entity.h') diff --git a/src/core/entity.h b/src/core/entity.h index 1bc93a1..5ddce3a 100644 --- a/src/core/entity.h +++ b/src/core/entity.h @@ -92,7 +92,7 @@ public: } /// pointer to the model, is used client-side - inline model::Model * model() { + inline model::Model * model() const { return entity_model; } @@ -197,23 +197,31 @@ public: entity_color_second.assign(color); } - /// set dirty flag + /** + * @brief set dirty flag + * setting the dirty flag will cause the server to broadcast changes + * to the clients. + */ inline void set_dirty(const bool dirty = true) { entity_dirty = dirty; } - /// mark the entity as destroyed + /** + * @brief mark the entity as destroyed + * die() should be called by the game module when it needs to destroy an entity, + * the game server will broadcast the delete event to the clients. + * The game module should not delete an entity directly. + */ virtual void die(); - /// runs one game frame for the entity /** + * @brief runs one game frame for the entity * The default implementation does nothing */ virtual void frame(float seconds); /** * @brief set the zone the entity is currently in - * * this fuction removes the entity from its previous zone * and removes it to the new one, if it is not 0 */ @@ -552,8 +560,8 @@ public: /// set afterburner/reverse void set_afterburner(float afterburner); - /// runs one game frame for the entity /** + * @brief runs one game frame for the entity * The default implementation will set direction() and thrust() to the desired targets * and calls its parent frame() funcion. */ @@ -564,18 +572,27 @@ public: protected: /* target_ variables can be set by the client */ - /// target thrust as set by the client + + /** + * @brief target thrust as set by the client + */ float target_thrust; - /// target direction as set by the client - /** target_direction must be in the [-1, 1] range + + /** + * @brief target direction as set by the client + * target_direction must be in the [-1, 1] range */ float target_direction; - /// target pitch as set by the client - /** target_pitch must be in the [-1, 1] range + + /** + * @brief target pitch as set by the client + * target_pitch must be in the [-1, 1] range */ float target_pitch; - /// target roll as set by the client - /** target_roll must be in the [-1, 1] range + + /** + * @brief target roll as set by the client + * target_roll must be in the [-1, 1] range */ float target_roll; -- cgit v1.2.3