Starshatter_Open
Open source Starshatter engine
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Drive.h
Go to the documentation of this file.
1 /* Project Starshatter 4.5
2  Destroyer Studios LLC
3  Copyright © 1997-2004. All Rights Reserved.
4 
5  SUBSYSTEM: Stars.exe
6  FILE: Drive.h
7  AUTHOR: John DiCamillo
8 
9 
10  OVERVIEW
11  ========
12  Conventional Drive (system) class
13 */
14 
15 #ifndef Drive_h
16 #define Drive_h
17 
18 #include "Types.h"
19 #include "System.h"
20 #include "Geometry.h"
21 
22 // +--------------------------------------------------------------------+
23 
24 class Bolt;
25 class DriveSprite;
26 class Light;
27 class Sound;
28 class Ship;
29 
30 // +--------------------------------------------------------------------+
31 
32 struct DrivePort {
33  static const char* TYPENAME() { return "DrivePort"; }
34 
35  DrivePort(const Point& l, float s);
36  ~DrivePort();
37 
39  float scale;
40 
43 };
44 
45 // +--------------------------------------------------------------------+
46 
47 class Drive : public System
48 {
49 public:
51  enum Constants { MAX_ENGINES=16 };
52 
53  Drive(SUBTYPE s, float max_thrust, float max_aug, bool show_trail=true);
54  Drive(const Drive& rhs);
55  virtual ~Drive();
56 
57  static void Initialize();
58  static void Close();
59  static void StartFrame();
60 
61  float Thrust(double seconds);
62  float MaxThrust() const { return thrust; }
63  float MaxAugmenter() const { return augmenter; }
64  int NumEngines() const;
65  DriveSprite* GetFlare(int port) const;
66  Bolt* GetTrail(int port) const;
67  bool IsAugmenterOn() const;
68 
69  virtual void AddPort(const Point& loc, float flare_scale=0);
70  virtual void CreatePort(const Point& loc, float flare_scale);
71 
72  virtual void Orient(const Physical* rep);
73 
74  void SetThrottle(double t, bool aug=false);
75  virtual double GetRequest(double seconds) const;
76 
77 protected:
78  float thrust;
79  float augmenter;
80  float scale;
81  float throttle;
83  float intensity;
84 
86 
89  bool show_trail;
90 };
91 
92 #endif Drive_h
93