diff options
author | Stijn Buys <ingar@osirion.org> | 2008-11-09 21:45:18 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2008-11-09 21:45:18 +0000 |
commit | a1eb1b4dc4d81df724ee43fc4e895dd22e81760f (patch) | |
tree | 5d53a557540147e1e981c5cd3c6be8ccc8448381 /src/game/base/jumppoint.h | |
parent | 568e868ef43cc79ad277ec5ab2c3e08647725131 (diff) |
working jumpgates
Diffstat (limited to 'src/game/base/jumppoint.h')
-rw-r--r-- | src/game/base/jumppoint.h | 30 |
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__ |