From 8898ad9b25fca6afe2374d293a981db02a83d7e9 Mon Sep 17 00:00:00 2001 From: "FWoltermann@gmail.com" Date: Thu, 31 May 2012 14:46:27 +0000 Subject: Committing the documentation to svn to have it accessible online --- Doc/doxygen/html/_nav_system_8cpp_source.html | 230 ++++++++++++++++++++++++++ 1 file changed, 230 insertions(+) create mode 100644 Doc/doxygen/html/_nav_system_8cpp_source.html (limited to 'Doc/doxygen/html/_nav_system_8cpp_source.html') diff --git a/Doc/doxygen/html/_nav_system_8cpp_source.html b/Doc/doxygen/html/_nav_system_8cpp_source.html new file mode 100644 index 0000000..c6a8a03 --- /dev/null +++ b/Doc/doxygen/html/_nav_system_8cpp_source.html @@ -0,0 +1,230 @@ + + + + + +Starshatter_Open: D:/SRC/StarshatterSVN/Stars45/NavSystem.cpp Source File + + + + + + + + + + + + + +
+
+ + + + + + +
+
Starshatter_Open +
+
Open source Starshatter engine
+
+
+ + + + + +
+
+ +
+
+
+ +
+ + + + +
+ +
+ +
+
+
NavSystem.cpp
+
+
+Go to the documentation of this file.
1 /* Project Starshatter 5.0
+
2  Destroyer Studios LLC
+
3  Copyright © 1997-2007. All Rights Reserved.
+
4 
+
5  SUBSYSTEM: Stars.exe
+
6  FILE: NavSystem.cpp
+
7  AUTHOR: John DiCamillo
+
8 
+
9 
+
10  OVERVIEW
+
11  ========
+
12  Navigation System class implementation
+
13 */
+
14 
+
15 #include "MemDebug.h"
+
16 #include "NavSystem.h"
+
17 #include "Ship.h"
+
18 #include "Sim.h"
+
19 #include "HUDSounds.h"
+
20 #include "Button.h"
+
21 #include "Game.h"
+
22 
+
23 // +----------------------------------------------------------------------+
+
24 
+ +
26 : System(COMPUTER, 2, "Auto Nav System", 1, 1,1,1),
+
27 autonav(0)
+
28 {
+
29  name = Game::GetText("sys.nav-system");
+
30  abrv = Game::GetText("sys.nav-system.abrv");
+
31 
+ +
33 }
+
34 
+
35 // +----------------------------------------------------------------------+
+
36 
+ +
38 : System(s), autonav(0)
+
39 {
+
40  Mount(s);
+
41 
+ +
43 }
+
44 
+
45 // +--------------------------------------------------------------------+
+
46 
+ +
48 { }
+
49 
+
50 // +--------------------------------------------------------------------+
+
51 
+
52 void
+
53 NavSystem::ExecFrame(double seconds)
+
54 {
+
55  if (autonav && ship && !ship->GetNextNavPoint())
+
56  autonav = false;
+
57 
+
58  energy = 0.0f;
+
59  System::ExecFrame(seconds);
+
60 }
+
61 
+
62 // +----------------------------------------------------------------------+
+
63 
+
64 bool
+ +
66 {
+
67  return ship && autonav && IsPowerOn();
+
68 }
+
69 
+
70 void
+ +
72 {
+
73  if (IsPowerOn() && !autonav) {
+
74  if (!ship->GetNextNavPoint()) {
+ +
76  }
+
77  else {
+ +
79  autonav = true;
+
80  }
+
81  }
+
82 }
+
83 
+
84 void
+ +
86 {
+
87  if (autonav)
+ +
89 
+
90  autonav = false;
+
91 }
+
92 
+
93 // +--------------------------------------------------------------------+
+
94 
+
95 void
+
96 NavSystem::Distribute(double delivered_energy, double seconds)
+
97 {
+
98  if (IsPowerOn()) {
+
99  // convert Joules to Watts:
+
100  energy = (float) (delivered_energy/seconds);
+
101 
+
102  // brown out:
+
103  if (energy < capacity*0.75f)
+
104  power_on = false;
+
105 
+
106  // spike:
+
107  else if (energy > capacity*1.5f) {
+
108  power_on = false;
+
109  ApplyDamage(50);
+
110  }
+
111  }
+
112 }
+
113 
+
+
+ + + + -- cgit v1.1