summaryrefslogtreecommitdiffhomepage
path: root/Stars45/Component.h
diff options
context:
space:
mode:
Diffstat (limited to 'Stars45/Component.h')
-rw-r--r--Stars45/Component.h110
1 files changed, 55 insertions, 55 deletions
diff --git a/Stars45/Component.h b/Stars45/Component.h
index c5bbdc2..f18d876 100644
--- a/Stars45/Component.h
+++ b/Stars45/Component.h
@@ -1,15 +1,15 @@
/* Project Starshatter 4.5
- Destroyer Studios LLC
- Copyright © 1997-2004. All Rights Reserved.
+ Destroyer Studios LLC
+ Copyright © 1997-2004. All Rights Reserved.
- SUBSYSTEM: Stars.exe
- FILE: Component.h
- AUTHOR: John DiCamillo
+ SUBSYSTEM: Stars.exe
+ FILE: Component.h
+ AUTHOR: John DiCamillo
- OVERVIEW
- ========
- Generic ship system sub-component class
+ OVERVIEW
+ ========
+ Generic ship system sub-component class
*/
#ifndef Component_h
@@ -24,20 +24,20 @@
class ComponentDesign
{
public:
- static const char* TYPENAME() { return "ComponentDesign"; }
+ static const char* TYPENAME() { return "ComponentDesign"; }
- ComponentDesign();
- ~ComponentDesign();
- int operator == (const ComponentDesign& rhs) const { return (name == rhs.name); }
+ ComponentDesign();
+ ~ComponentDesign();
+ int operator == (const ComponentDesign& rhs) const { return (name == rhs.name); }
- // identification:
- Text name;
- Text abrv;
+ // identification:
+ Text name;
+ Text abrv;
- float repair_time;
- float replace_time;
- int spares;
- DWORD affects;
+ float repair_time;
+ float replace_time;
+ int spares;
+ DWORD affects;
};
// +--------------------------------------------------------------------+
@@ -49,51 +49,51 @@ class System;
class Component
{
public:
- static const char* TYPENAME() { return "Component"; }
+ static const char* TYPENAME() { return "Component"; }
- enum STATUS { DESTROYED, CRITICAL, DEGRADED, NOMINAL, REPLACE, REPAIR };
- enum DAMAGE { DAMAGE_EFFICIENCY = 0x01,
- DAMAGE_SAFETY = 0x02,
- DAMAGE_STABILITY = 0x04 };
+ enum STATUS { DESTROYED, CRITICAL, DEGRADED, NOMINAL, REPLACE, REPAIR };
+ enum DAMAGE { DAMAGE_EFFICIENCY = 0x01,
+ DAMAGE_SAFETY = 0x02,
+ DAMAGE_STABILITY = 0x04 };
- Component(ComponentDesign* d, System* s);
- Component(const Component& c);
- virtual ~Component();
+ Component(ComponentDesign* d, System* s);
+ Component(const Component& c);
+ virtual ~Component();
- const char* Name() const { return design->name; }
- const char* Abbreviation() const { return design->abrv; }
- float RepairTime() const { return design->repair_time; }
- float ReplaceTime() const { return design->replace_time; }
+ const char* Name() const { return design->name; }
+ const char* Abbreviation() const { return design->abrv; }
+ float RepairTime() const { return design->repair_time; }
+ float ReplaceTime() const { return design->replace_time; }
- bool DamageEfficiency() const { return (design->affects & DAMAGE_EFFICIENCY)?true:false; }
- bool DamageSafety() const { return (design->affects & DAMAGE_SAFETY)?true:false; }
- bool DamageStability() const { return (design->affects & DAMAGE_STABILITY)?true:false; }
+ bool DamageEfficiency() const { return (design->affects & DAMAGE_EFFICIENCY)?true:false; }
+ bool DamageSafety() const { return (design->affects & DAMAGE_SAFETY)?true:false; }
+ bool DamageStability() const { return (design->affects & DAMAGE_STABILITY)?true:false; }
- STATUS Status() const { return status; }
- float Availability() const;
- float TimeRemaining() const;
- int SpareCount() const;
- bool IsJerried() const;
- int NumJerried() const;
+ STATUS Status() const { return status; }
+ float Availability() const;
+ float TimeRemaining() const;
+ int SpareCount() const;
+ bool IsJerried() const;
+ int NumJerried() const;
- void SetSystem(System* s) { system = s; }
- System* GetSystem() const { return system; }
+ void SetSystem(System* s) { system = s; }
+ System* GetSystem() const { return system; }
- virtual void ApplyDamage(double damage);
- virtual void ExecMaintFrame(double seconds);
- virtual void Repair();
- virtual void Replace();
+ virtual void ApplyDamage(double damage);
+ virtual void ExecMaintFrame(double seconds);
+ virtual void Repair();
+ virtual void Replace();
protected:
- ComponentDesign* design;
-
- // Component health status:
- STATUS status;
- float availability;
- float time_remaining;
- int spares;
- int jerried;
- System* system;
+ ComponentDesign* design;
+
+ // Component health status:
+ STATUS status;
+ float availability;
+ float time_remaining;
+ int spares;
+ int jerried;
+ System* system;
};
#endif Component_h