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/_computer_8cpp_source.html | 210 ++++++++++++++++++++++++++++ 1 file changed, 210 insertions(+) create mode 100644 Doc/doxygen/html/_computer_8cpp_source.html (limited to 'Doc/doxygen/html/_computer_8cpp_source.html') diff --git a/Doc/doxygen/html/_computer_8cpp_source.html b/Doc/doxygen/html/_computer_8cpp_source.html new file mode 100644 index 0000000..37538cc --- /dev/null +++ b/Doc/doxygen/html/_computer_8cpp_source.html @@ -0,0 +1,210 @@ + + + + + +Starshatter_Open: D:/SRC/StarshatterSVN/Stars45/Computer.cpp Source File + + + + + + + + + + + + + +
+
+ + + + + + +
+
Starshatter_Open +
+
Open source Starshatter engine
+
+
+ + + + + +
+
+ +
+
+
+ +
+ + + + +
+ +
+ +
+
+
Computer.cpp
+
+
+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: Computer.cpp
+
7  AUTHOR: John DiCamillo
+
8 
+
9 
+
10  OVERVIEW
+
11  ========
+
12  Computer System class
+
13 */
+
14 
+
15 #include "MemDebug.h"
+
16 #include "Computer.h"
+
17 #include "Game.h"
+
18 
+
19 // +----------------------------------------------------------------------+
+
20 
+
21 static int computer_value[] = {
+
22  0, 1, 1, 1, 1
+
23 };
+
24 
+
25 // +----------------------------------------------------------------------+
+
26 
+
27 Computer::Computer(int comp_type, const char* comp_name)
+
28 : System(COMPUTER, comp_type, comp_name, 1, 1, 1, 1)
+
29 {
+
30  SetAbbreviation(Game::GetText("sys.computer.abrv"));
+ +
32 
+
33  if (subtype == FLIGHT) {
+
34  crit_level = -1.0f;
+
35  }
+
36 }
+
37 
+
38 // +----------------------------------------------------------------------+
+
39 
+ +
41 : System(c)
+
42 {
+
43  Mount(c);
+ + +
46 
+
47  if (subtype == FLIGHT) {
+
48  crit_level = -1.0f;
+
49  }
+
50 }
+
51 
+
52 // +--------------------------------------------------------------------+
+
53 
+ +
55 { }
+
56 
+
57 // +--------------------------------------------------------------------+
+
58 
+
59 void
+
60 Computer::ApplyDamage(double damage)
+
61 {
+
62  System::ApplyDamage(damage);
+
63 }
+
64 
+
65 // +--------------------------------------------------------------------+
+
66 
+
67 void
+
68 Computer::ExecFrame(double seconds)
+
69 {
+
70  energy = 0.0f;
+
71  System::ExecFrame(seconds);
+
72 }
+
73 
+
74 // +--------------------------------------------------------------------+
+
75 
+
76 void
+
77 Computer::Distribute(double delivered_energy, double seconds)
+
78 {
+
79  if (IsPowerOn()) {
+
80  // convert Joules to Watts:
+
81  energy = (float) (delivered_energy/seconds);
+
82 
+
83  // brown out:
+
84  if (energy < capacity*0.75f)
+
85  power_on = false;
+
86 
+
87  // spike:
+
88  else if (energy > capacity*1.5f) {
+
89  power_on = false;
+
90  ApplyDamage(50);
+
91  }
+
92  }
+
93 }
+
+
+ + + + -- cgit v1.1