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>2008-11-09 21:45:18 +0000
committerStijn Buys <ingar@osirion.org>2008-11-09 21:45:18 +0000
commita1eb1b4dc4d81df724ee43fc4e895dd22e81760f (patch)
tree5d53a557540147e1e981c5cd3c6be8ccc8448381 /src/game/base/jumppoint.h
parent568e868ef43cc79ad277ec5ab2c3e08647725131 (diff)
working jumpgates
Diffstat (limited to 'src/game/base/jumppoint.h')
-rw-r--r--src/game/base/jumppoint.h30
1 files changed, 26 insertions, 4 deletions
diff --git a/src/game/base/jumppoint.h b/src/game/base/jumppoint.h
index 4680832..626a4ad 100644
--- a/src/game/base/jumppoint.h
+++ b/src/game/base/jumppoint.h
@@ -12,28 +12,50 @@
#include <string>
-namespace base {
+namespace game {
-/// a jump point
+/// a jumppoint
/**
* jumppoints are used to define hyperspace routes between systems
* when a ship actives the jump drive, a jump point will be opened
* between the current system and the target of the nearest jumppoint.
*
*/
-class JumpPoint : public core::Entity {
+class JumpPoint : public core::EntityDynamic {
public:
JumpPoint();
~JumpPoint();
inline std::string const & targetlabel() { return jumppoint_targetlabel; }
+
inline JumpPoint *target() { return jumppoint_target; }
- std::string jumppoint_targetlabel;
+ /// set trget label
+ void set_targetlabel(const std::string &label);
+
+ /// validate the targetlabel and set target()
+ void validate();
+private:
+ std::string jumppoint_targetlabel;
JumpPoint *jumppoint_target;
};
+/// a jumpgate
+class JumpGate : public JumpPoint {
+public:
+ JumpGate();
+ virtual ~JumpGate();
+
+ inline bool activated() const { return (jumpgate_timer > 0); }
+
+ void activate();
+
+ virtual void frame(float elapsed);
+private:
+ float jumpgate_timer;
+};
+
}
#endif // __INCLUDED_BASE_JUMPPOINT_H__