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>2011-07-11 19:33:27 +0000
committerStijn Buys <ingar@osirion.org>2011-07-11 19:33:27 +0000
commit83c9d657773fa4f829b533791697ed07e0d9d962 (patch)
tree0c53d6a6d71c14894ac51124933ae31b66164217 /src/game/base/ship.h
parent99bd770a6030805ecd2cb22671e8f29d32fd59db (diff)
Initial support for saving player data in multiplayer games,
have ships remember their docks and spawns.
Diffstat (limited to 'src/game/base/ship.h')
-rw-r--r--src/game/base/ship.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/game/base/ship.h b/src/game/base/ship.h
index 37dae0d..f705231 100644
--- a/src/game/base/ship.h
+++ b/src/game/base/ship.h
@@ -23,6 +23,8 @@ public:
Ship(core::Player *owner, const ShipModel *shipmodel);
~Ship();
+ /* -- inspectors ------------------------------------------- */
+
/// shipmodel
inline const ShipModel *shipmodel() const {
return ship_shipmodel;
@@ -52,7 +54,19 @@ public:
inline const float roll_force() const {
return ship_roll_force;
}
+
+ /// entity the ship is currently docked at
+ inline core::Entity *dock() {
+ return ship_dock;
+ }
+
+ /// (dockable) entity where the ship will respawn if destroyed
+ core::Entity *spawn() {
+ return ship_spawn;
+ }
+ /* -- mutators --------------------------------------------- */
+
/// physics frame
virtual void action (btScalar seconds);
@@ -112,6 +126,17 @@ public:
/// toggle jump drive activation
void func_jump(std::string const & args);
+
+ virtual void set_state(int state);
+ /**
+ * @brief dock the ship at a station, planet or another player's ship_dock
+ * This will set the ship's state to Entity::Docked and reset spawn if required
+ */
+ void set_dock(core::Entity *dock);
+
+ void launch();
+
+ void set_spawn(core::Entity *spawn);
private:
JumpPoint *find_closest_jumppoint();
@@ -138,6 +163,10 @@ private:
float ship_strafe_force;
float ship_turn_force;
float ship_roll_force;
+
+ core::Entity *ship_dock;
+
+ core::Entity *ship_spawn;
};
}