Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2012-11-25 12:06:13 +0000
committerStijn Buys <ingar@osirion.org>2012-11-25 12:06:13 +0000
commitd8be908233fd7b85492d7a9e87f07bb207173990 (patch)
tree70d9103a867688838fc517290bb370366c69fedb /src/core/entityglobe.h
parentedc5ddce817244111b302e449c28a052f2746cc4 (diff)
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.
Diffstat (limited to 'src/core/entityglobe.h')
-rw-r--r--src/core/entityglobe.h96
1 files changed, 96 insertions, 0 deletions
diff --git a/src/core/entityglobe.h b/src/core/entityglobe.h
new file mode 100644
index 0000000..e60f61a
--- /dev/null
+++ b/src/core/entityglobe.h
@@ -0,0 +1,96 @@
+/*
+ core/entityglobe.h
+ This file is part of the Osirion project and is distributed under
+ the terms of the GNU General Public License version 2.
+*/
+
+#ifndef __INCLUDED_CORE_ENTITYGLOBE_H__
+#define __INCLUDED_CORE_ENTITYGLOBE_H__
+
+#include "core/entity.h"
+
+namespace core
+{
+
+/// 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;
+};
+
+}
+
+#endif // __INCLUDED_CORE_ENTITYGLOBE_H__