From 69209c38968c6f4066a772e0a51a2928749217de Mon Sep 17 00:00:00 2001 From: "FWoltermann@gmail.com" Date: Fri, 9 Dec 2011 19:00:23 +0000 Subject: Re-indenting the code to use standard tabs. Yes, I know this is pretty pointless, but who cares? --- Stars45/WeaponGroup.cpp | 246 ++++++++++++++++++++++++------------------------ 1 file changed, 123 insertions(+), 123 deletions(-) (limited to 'Stars45/WeaponGroup.cpp') diff --git a/Stars45/WeaponGroup.cpp b/Stars45/WeaponGroup.cpp index 3998ff5..9a69af4 100644 --- a/Stars45/WeaponGroup.cpp +++ b/Stars45/WeaponGroup.cpp @@ -1,15 +1,15 @@ /* Project Starshatter 4.5 - Destroyer Studios LLC - Copyright © 1997-2005. All Rights Reserved. + Destroyer Studios LLC + Copyright © 1997-2005. All Rights Reserved. - SUBSYSTEM: Stars.exe - FILE: WeaponGroup.cpp - AUTHOR: John DiCamillo + SUBSYSTEM: Stars.exe + FILE: WeaponGroup.cpp + AUTHOR: John DiCamillo - OVERVIEW - ======== - Weapon Control Category (Group) class + OVERVIEW + ======== + Weapon Control Category (Group) class */ #include "MemDebug.h" @@ -19,16 +19,16 @@ // +----------------------------------------------------------------------+ WeaponGroup::WeaponGroup(const char* n) - : selected(0), trigger(false), orders(Weapon::MANUAL), - control(Weapon::SINGLE_FIRE), sweep(Weapon::SWEEP_TIGHT), - mass(0.0f), resist(0.0f), name(n), ammo(0) +: selected(0), trigger(false), orders(Weapon::MANUAL), +control(Weapon::SINGLE_FIRE), sweep(Weapon::SWEEP_TIGHT), +mass(0.0f), resist(0.0f), name(n), ammo(0) { } // +--------------------------------------------------------------------+ WeaponGroup::~WeaponGroup() { - weapons.destroy(); + weapons.destroy(); } // +--------------------------------------------------------------------+ @@ -36,13 +36,13 @@ WeaponGroup::~WeaponGroup() void WeaponGroup::SetName(const char* n) { - name = n; + name = n; } void WeaponGroup::SetAbbreviation(const char* a) { - abrv = a; + abrv = a; } // +--------------------------------------------------------------------+ @@ -50,55 +50,55 @@ WeaponGroup::SetAbbreviation(const char* a) bool WeaponGroup::IsPrimary() const { - if (weapons.size() > 0) - return weapons[0]->IsPrimary(); + if (weapons.size() > 0) + return weapons[0]->IsPrimary(); - return false; + return false; } bool WeaponGroup::IsDrone() const { - if (weapons.size() > 0) - return weapons[0]->IsDrone(); + if (weapons.size() > 0) + return weapons[0]->IsDrone(); - return false; + return false; } bool WeaponGroup::IsDecoy() const { - if (weapons.size() > 0) - return weapons[0]->IsDecoy(); + if (weapons.size() > 0) + return weapons[0]->IsDecoy(); - return false; + return false; } bool WeaponGroup::IsProbe() const { - if (weapons.size() > 0) - return weapons[0]->IsProbe(); + if (weapons.size() > 0) + return weapons[0]->IsProbe(); - return false; + return false; } bool WeaponGroup::IsMissile() const { - if (weapons.size() > 0) - return weapons[0]->IsMissile(); + if (weapons.size() > 0) + return weapons[0]->IsMissile(); - return false; + return false; } bool WeaponGroup::IsBeam() const { - if (weapons.size() > 0) - return weapons[0]->IsBeam(); + if (weapons.size() > 0) + return weapons[0]->IsBeam(); - return false; + return false; } // +--------------------------------------------------------------------+ @@ -106,25 +106,25 @@ WeaponGroup::IsBeam() const void WeaponGroup::AddWeapon(Weapon* w) { - weapons.append(w); + weapons.append(w); } int WeaponGroup::NumWeapons() const { - return weapons.size(); + return weapons.size(); } List& WeaponGroup::GetWeapons() { - return weapons; + return weapons; } bool WeaponGroup::Contains(const Weapon* w) const { - return weapons.contains(w)?true:false; + return weapons.contains(w)?true:false; } // +--------------------------------------------------------------------+ @@ -132,41 +132,41 @@ WeaponGroup::Contains(const Weapon* w) const void WeaponGroup::SelectWeapon(int n) { - if (n >= 0 && n < weapons.size()) - selected = n; + if (n >= 0 && n < weapons.size()) + selected = n; } void WeaponGroup::CycleWeapon() { - selected++; + selected++; - if (selected >= weapons.size()) - selected = 0; + if (selected >= weapons.size()) + selected = 0; } Weapon* WeaponGroup::GetWeapon(int n) const { - if (n >= 0 && n < weapons.size()) - return weapons[n]; + if (n >= 0 && n < weapons.size()) + return weapons[n]; - return 0; + return 0; } Weapon* WeaponGroup::GetSelected() const { - return weapons[selected]; + return weapons[selected]; } bool WeaponGroup::CanTarget(DWORD tgt_class) const { - if (selected >= 0 && selected < weapons.size()) - return weapons[selected]->CanTarget(tgt_class); + if (selected >= 0 && selected < weapons.size()) + return weapons[selected]->CanTarget(tgt_class); - return false; + return false; } // +--------------------------------------------------------------------+ @@ -174,36 +174,36 @@ WeaponGroup::CanTarget(DWORD tgt_class) const void WeaponGroup::ExecFrame(double seconds) { - ammo = 0; - mass = 0.0f; - resist = 0.0f; + ammo = 0; + mass = 0.0f; + resist = 0.0f; - ListIter iter = weapons; - while (++iter) { - Weapon* w = iter.value(); - w->ExecFrame(seconds); + ListIter iter = weapons; + while (++iter) { + Weapon* w = iter.value(); + w->ExecFrame(seconds); - ammo += w->Ammo(); - mass += w->Mass(); - resist += w->Resistance(); - } + ammo += w->Ammo(); + mass += w->Mass(); + resist += w->Resistance(); + } } void WeaponGroup::CheckAmmo() { - ammo = 0; - mass = 0.0f; - resist = 0.0f; + ammo = 0; + mass = 0.0f; + resist = 0.0f; - ListIter iter = weapons; - while (++iter) { - Weapon* w = iter.value(); + ListIter iter = weapons; + while (++iter) { + Weapon* w = iter.value(); - ammo += w->Ammo(); - mass += w->Mass(); - resist += w->Resistance(); - } + ammo += w->Ammo(); + mass += w->Mass(); + resist += w->Resistance(); + } } // +--------------------------------------------------------------------+ @@ -211,39 +211,39 @@ WeaponGroup::CheckAmmo() void WeaponGroup::SetTarget(SimObject* target, System* subtarget) { - ListIter w = weapons; - while (++w) - w->SetTarget(target, subtarget); + ListIter w = weapons; + while (++w) + w->SetTarget(target, subtarget); } SimObject* WeaponGroup::GetTarget() const { - SimObject* target = 0; + SimObject* target = 0; - if (weapons.size()) - target = weapons[0]->GetTarget(); + if (weapons.size()) + target = weapons[0]->GetTarget(); - return target; + return target; } System* WeaponGroup::GetSubTarget() const { - System* subtarget = 0; + System* subtarget = 0; - if (weapons.size()) - subtarget = weapons[0]->GetSubTarget(); + if (weapons.size()) + subtarget = weapons[0]->GetSubTarget(); - return subtarget; + return subtarget; } void WeaponGroup::DropTarget() { - ListIter w = weapons; - while (++w) - w->SetTarget(0, 0); + ListIter w = weapons; + while (++w) + w->SetTarget(0, 0); } // +--------------------------------------------------------------------+ @@ -251,10 +251,10 @@ WeaponGroup::DropTarget() WeaponDesign* WeaponGroup::GetDesign() const { - if (selected >= 0 && selected < weapons.size()) - return (WeaponDesign*) weapons[selected]->Design(); + if (selected >= 0 && selected < weapons.size()) + return (WeaponDesign*) weapons[selected]->Design(); - return 0; + return 0; } // +--------------------------------------------------------------------+ @@ -262,24 +262,24 @@ WeaponGroup::GetDesign() const int WeaponGroup::Status() const { - int status = System::NOMINAL; - int critical = true; + int status = System::NOMINAL; + int critical = true; - ListIter iter = (List&) weapons; // cast-away const - while (++iter) { - Weapon* w = iter.value(); + ListIter iter = (List&) weapons; // cast-away const + while (++iter) { + Weapon* w = iter.value(); - if (w->Status() < System::NOMINAL) - status = System::DEGRADED; + if (w->Status() < System::NOMINAL) + status = System::DEGRADED; - if (w->Status() > System::CRITICAL) - critical = false; - } + if (w->Status() > System::CRITICAL) + critical = false; + } - if (critical) - return System::CRITICAL; + if (critical) + return System::CRITICAL; - return status; + return status; } // +--------------------------------------------------------------------+ @@ -287,31 +287,31 @@ WeaponGroup::Status() const void WeaponGroup::SetFiringOrders(int o) { - orders = o; + orders = o; - ListIter w = weapons; - while (++w) - w->SetFiringOrders(orders); + ListIter w = weapons; + while (++w) + w->SetFiringOrders(orders); } void WeaponGroup::SetControlMode(int m) { - control = m; + control = m; - ListIter w = weapons; - while (++w) - w->SetControlMode(control); + ListIter w = weapons; + while (++w) + w->SetControlMode(control); } void WeaponGroup::SetSweep(int s) { - sweep = s; + sweep = s; - ListIter w = weapons; - while (++w) - w->SetSweep(sweep); + ListIter w = weapons; + while (++w) + w->SetSweep(sweep); } // +--------------------------------------------------------------------+ @@ -319,17 +319,17 @@ WeaponGroup::SetSweep(int s) void WeaponGroup::PowerOff() { - ListIter w = weapons; - while (++w) - w->PowerOff(); + ListIter w = weapons; + while (++w) + w->PowerOff(); } void WeaponGroup::PowerOn() { - ListIter w = weapons; - while (++w) - w->PowerOn(); + ListIter w = weapons; + while (++w) + w->PowerOn(); } // +--------------------------------------------------------------------+ @@ -337,12 +337,12 @@ WeaponGroup::PowerOn() int WeaponGroup::Value() const { - int result = 0; + int result = 0; - for (int i = 0; i < weapons.size(); i++) { - const Weapon* w = weapons[i]; - result += w->Value(); - } + for (int i = 0; i < weapons.size(); i++) { + const Weapon* w = weapons[i]; + result += w->Value(); + } - return result; + return result; } -- cgit v1.1