From d8be908233fd7b85492d7a9e87f07bb207173990 Mon Sep 17 00:00:00 2001 From: Stijn Buys Date: Sun, 25 Nov 2012 12:06:13 +0000 Subject: Moved core::EntityGlobe into a separate file, added various methods to core::Item and core::Slot, added r_slots cvar to draw entity slots and docks, added game methods for mounting and umounting of weapons, added playerlist to chat window. --- src/core/entity.h | 89 ++++--------------------------------------------------- 1 file changed, 5 insertions(+), 84 deletions(-) (limited to 'src/core/entity.h') diff --git a/src/core/entity.h b/src/core/entity.h index d3c8522..31ed67b 100644 --- a/src/core/entity.h +++ b/src/core/entity.h @@ -50,16 +50,16 @@ public: * ShowOnMap will make the entity appear on the map * KeepAlive is used by EntityDynamic and marks the entity as deletable in the keepalive run * */ - enum Flags {NonSolid = 2, Bright = 4, Dockable = 8, ShowOnMap = 16, KeepAlive = 32}; + enum Flags { NonSolid = 2, Bright = 4, Dockable = 8, ShowOnMap = 16, KeepAlive = 32 }; /// Entity type constants - enum Type {Default = 0, Dynamic = 1, Controlable = 2, Globe = 3}; + enum Type { Default = 0, Dynamic = 1, Controlable = 2, Globe = 3, Projectile = 4 }; /// Entity shape constants - enum Shape {Diamond = 0, Sphere = 1, Cube = 2, Axis = 3}; + enum Shape { Diamond = 0, Sphere = 1, Cube = 2, Axis = 3 }; /// EntityDynamic State constants - enum State {Normal = 0, NoPower = 1, ImpulseInitiate = 2, Impulse = 3, JumpInitiate = 4, Jump = 5, Docked = 6, Destroyed = 7}; + enum State { Normal = 0, NoPower = 1, ImpulseInitiate = 2, Impulse = 3, JumpInitiate = 4, Jump = 5, Docked = 6, Destroyed = 7 }; /// entity menus collection typedef typedef std::list Menus; @@ -854,86 +854,7 @@ private: }; -/// a Globe entity -class EntityGlobe : public Entity -{ -public: - /// server-side constructor - EntityGlobe(); - EntityGlobe(std::istream & is); - - virtual ~EntityGlobe(); - - /*----- inspectors ----------------------------------------------- */ - /// core type id - virtual inline const unsigned int type() const { - return Entity::Globe; - } - - /// texture name - inline const std::string &texturename() const { - return entity_texturename; - } - - /// texture render id - inline size_t texture_id() const { - return entity_texture_id; - } - - /// corona texture name - inline const std::string &coronaname() const { - return entity_coronaname; - } - - /// corona texture id - inline size_t corona_id() const { - return entity_corona_id; - } - - /// rotation speed in degrees per second - inline float rotationspeed() const { - return entity_rotationspeed; - } - - /*----- mutators -------------------------------------------------- */ - - inline void set_rotationspeed(const float rotationspeed) { - entity_rotationspeed = rotationspeed; - } - - inline void set_texture_id(size_t texture_id) { - entity_texture_id = texture_id; - } - - inline void set_corona_id(size_t texture_id) { - entity_corona_id = texture_id; - } - - inline void set_texturename(const std::string & texturename) { - entity_texturename.assign(texturename); - } - - inline void set_coronaname(const std::string & texturename) { - entity_coronaname.assign(texturename); - } - - /*----- serializers ----------------------------------------------- */ - - /// serialize the entity to a stream - virtual void serialize_server_create(std::ostream & os) const; - - /// receive a server-to-client create from a stream - virtual void receive_server_create(std::istream &is); - -private: - float entity_rotationspeed; - size_t entity_texture_id; - size_t entity_corona_id; - std::string entity_texturename; - std::string entity_coronaname; -}; - -} +} // namespace core #endif // __INCLUDED_CORE_ENTITY_H__ -- cgit v1.2.3