Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/base/ship.h')
-rw-r--r--src/game/base/ship.h30
1 files changed, 29 insertions, 1 deletions
diff --git a/src/game/base/ship.h b/src/game/base/ship.h
index ad2c71b..7b25f18 100644
--- a/src/game/base/ship.h
+++ b/src/game/base/ship.h
@@ -24,6 +24,8 @@ const float MIN_DELTA = 0.000001f;
class Ship : public core::EntityControlable
{
public:
+ enum AutoPilotFlags { AutoPilotDisabled = 0, AutoPilotEnabled = 1, AutoPilotDock = 2, AutoPilotFormation = 4 };
+
Ship(core::Player *owner, const ShipModel *shipmodel);
~Ship();
@@ -72,11 +74,21 @@ public:
}
/// (dockable) entity where the ship will respawn if destroyed
- core::Entity *spawn()
+ inline core::Entity *spawn()
{
return ship_spawn;
}
+ /// current autopilot target
+ inline core::Entity *autopilot_target()
+ {
+ return ship_autopilot_target;
+ }
+
+ inline bool has_autopilot_flag(const AutoPilotFlags flag) {
+ return ( (ship_autopilot_flags & flag) == flag);
+ }
+
/// maximum amount of armor
inline const float maxarmor() const
{
@@ -177,6 +189,19 @@ public:
*/
void set_dock(core::Entity *dock);
+ /**
+ * @brief set the autopilot target
+ * */
+ void set_autopilot_target(core::Entity *target);
+
+ inline void set_autopilot_flag(const AutoPilotFlags flag) {
+ ship_autopilot_flags = ship_autopilot_flags | flag;
+ }
+
+ inline void unset_autopilot_flag(const AutoPilotFlags flag) {
+ ship_autopilot_flags = ship_autopilot_flags & ~flag;
+ }
+
void launch();
void set_spawn(core::Entity *spawn);
@@ -227,6 +252,9 @@ private:
core::Entity *ship_dock;
core::Entity *ship_spawn;
+
+ int ship_autopilot_flags;
+ core::Entity *ship_autopilot_target;
};
}