summaryrefslogtreecommitdiffhomepage
path: root/Stars45/Instruction.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'Stars45/Instruction.cpp')
-rw-r--r--Stars45/Instruction.cpp842
1 files changed, 421 insertions, 421 deletions
diff --git a/Stars45/Instruction.cpp b/Stars45/Instruction.cpp
index 2cad9b3..73f6fcf 100644
--- a/Stars45/Instruction.cpp
+++ b/Stars45/Instruction.cpp
@@ -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: Instruction.cpp
- AUTHOR: John DiCamillo
+ SUBSYSTEM: Stars.exe
+ FILE: Instruction.cpp
+ AUTHOR: John DiCamillo
- OVERVIEW
- ========
- Navigation Point class implementation
+ OVERVIEW
+ ========
+ Navigation Point class implementation
*/
#include "MemDebug.h"
@@ -25,41 +25,41 @@
// +----------------------------------------------------------------------+
Instruction::Instruction(int act, const char* tgt)
- : region(0), action(act), formation(0), tgt_name(tgt),
- status(PENDING), speed(0), target(0), emcon(0), wep_free(0),
- priority(PRIMARY), farcast(0), hold_time(0)
+: region(0), action(act), formation(0), tgt_name(tgt),
+status(PENDING), speed(0), target(0), emcon(0), wep_free(0),
+priority(PRIMARY), farcast(0), hold_time(0)
{ }
Instruction::Instruction(const char* rgn, Point loc, int act)
- : region(0), action(act), formation(0),
- status(PENDING), speed(0), target(0), emcon(0), wep_free(0),
- priority(PRIMARY), farcast(0), hold_time(0)
+: region(0), action(act), formation(0),
+status(PENDING), speed(0), target(0), emcon(0), wep_free(0),
+priority(PRIMARY), farcast(0), hold_time(0)
{
- rgn_name = rgn;
- rloc.SetBaseLocation(loc);
- rloc.SetDistance(0);
+ rgn_name = rgn;
+ rloc.SetBaseLocation(loc);
+ rloc.SetDistance(0);
}
Instruction::Instruction(SimRegion* rgn, Point loc, int act)
- : region(rgn), action(act), formation(0),
- status(PENDING), speed(0), target(0), emcon(0), wep_free(0),
- priority(PRIMARY), farcast(0), hold_time(0)
+: region(rgn), action(act), formation(0),
+status(PENDING), speed(0), target(0), emcon(0), wep_free(0),
+priority(PRIMARY), farcast(0), hold_time(0)
{
- rgn_name = region->Name();
- rloc.SetBaseLocation(loc);
- rloc.SetDistance(0);
+ rgn_name = region->Name();
+ rloc.SetBaseLocation(loc);
+ rloc.SetDistance(0);
}
Instruction::Instruction(const Instruction& instr)
- : region(instr.region), rgn_name(instr.rgn_name),
- rloc(instr.rloc), action(instr.action),
- formation(instr.formation), status(instr.status), speed(instr.speed),
- target(0), tgt_name(instr.tgt_name), tgt_desc(instr.tgt_desc),
- emcon(instr.emcon), wep_free(instr.wep_free),
- priority(instr.priority), farcast(instr.farcast),
- hold_time(instr.hold_time)
+: region(instr.region), rgn_name(instr.rgn_name),
+rloc(instr.rloc), action(instr.action),
+formation(instr.formation), status(instr.status), speed(instr.speed),
+target(0), tgt_name(instr.tgt_name), tgt_desc(instr.tgt_desc),
+emcon(instr.emcon), wep_free(instr.wep_free),
+priority(instr.priority), farcast(instr.farcast),
+hold_time(instr.hold_time)
{
- SetTarget(instr.target);
+ SetTarget(instr.target);
}
Instruction::~Instruction()
@@ -70,25 +70,25 @@ Instruction::~Instruction()
Instruction&
Instruction::operator = (const Instruction& n)
{
- rgn_name = n.rgn_name;
- region = n.region;
- rloc = n.rloc;
- action = n.action;
- formation = n.formation;
- status = n.status;
- speed = n.speed;
-
- tgt_name = n.tgt_name;
- tgt_desc = n.tgt_desc;
- target = 0;
- emcon = n.emcon;
- wep_free = n.wep_free;
- priority = n.priority;
- farcast = n.farcast;
- hold_time = n.hold_time;
-
- SetTarget(n.target);
- return *this;
+ rgn_name = n.rgn_name;
+ region = n.region;
+ rloc = n.rloc;
+ action = n.action;
+ formation = n.formation;
+ status = n.status;
+ speed = n.speed;
+
+ tgt_name = n.tgt_name;
+ tgt_desc = n.tgt_desc;
+ target = 0;
+ emcon = n.emcon;
+ wep_free = n.wep_free;
+ priority = n.priority;
+ farcast = n.farcast;
+ hold_time = n.hold_time;
+
+ SetTarget(n.target);
+ return *this;
}
// +--------------------------------------------------------------------+
@@ -96,16 +96,16 @@ Instruction::operator = (const Instruction& n)
Point
Instruction::Location() const
{
- Instruction* pThis = (Instruction*) this;
- return pThis->rloc.Location();
+ Instruction* pThis = (Instruction*) this;
+ return pThis->rloc.Location();
}
void
Instruction::SetLocation(const Point& l)
{
- rloc.SetBaseLocation(l);
- rloc.SetReferenceLoc(0);
- rloc.SetDistance(0);
+ rloc.SetBaseLocation(l);
+ rloc.SetReferenceLoc(0);
+ rloc.SetDistance(0);
}
// +----------------------------------------------------------------------+
@@ -113,59 +113,59 @@ Instruction::SetLocation(const Point& l)
SimObject*
Instruction::GetTarget()
{
- if (!target && tgt_name.length() > 0) {
- Sim* sim = Sim::GetSim();
+ if (!target && tgt_name.length() > 0) {
+ Sim* sim = Sim::GetSim();
- if (sim) {
- Ship* s = sim->FindShip(tgt_name, rgn_name);
+ if (sim) {
+ Ship* s = sim->FindShip(tgt_name, rgn_name);
- if (s) {
- target = s;
- Observe(target);
- }
- }
- }
+ if (s) {
+ target = s;
+ Observe(target);
+ }
+ }
+ }
- return target;
+ return target;
}
void
Instruction::SetTarget(const char* n)
{
- if (n && *n && tgt_name != n) {
- tgt_name = n;
- tgt_desc = n;
+ if (n && *n && tgt_name != n) {
+ tgt_name = n;
+ tgt_desc = n;
- if (target)
- target = 0;
- }
+ if (target)
+ target = 0;
+ }
}
void
Instruction::SetTarget(SimObject* s)
{
- if (s && target != s) {
- tgt_name = s->Name();
- target = s;
- Observe(target);
- }
+ if (s && target != s) {
+ tgt_name = s->Name();
+ target = s;
+ Observe(target);
+ }
}
void
Instruction::SetTargetDesc(const char* d)
{
- if (d && *d)
- tgt_desc = d;
+ if (d && *d)
+ tgt_desc = d;
}
void
Instruction::ClearTarget()
{
- if (target) {
- target = 0;
- tgt_name = "";
- tgt_desc = "";
- }
+ if (target) {
+ target = 0;
+ tgt_name = "";
+ tgt_desc = "";
+ }
}
// +----------------------------------------------------------------------+
@@ -173,16 +173,16 @@ Instruction::ClearTarget()
bool
Instruction::Update(SimObject* obj)
{
- if (target == obj)
- target = 0;
+ if (target == obj)
+ target = 0;
- return SimObserver::Update(obj);
+ return SimObserver::Update(obj);
}
const char*
Instruction::GetObserverName() const
{
- return "Instruction";
+ return "Instruction";
}
// +----------------------------------------------------------------------+
@@ -190,145 +190,145 @@ Instruction::GetObserverName() const
void
Instruction::Evaluate(Ship* ship)
{
- Sim* sim = Sim::GetSim();
-
- switch (action) {
- case VECTOR:
- break;
-
- case LAUNCH:
- if (ship->GetFlightPhase() == Ship::ACTIVE)
- SetStatus(COMPLETE);
- break;
-
- case DOCK:
- case RTB:
- if (sim->GetPlayerShip() == ship &&
- (ship->GetFlightPhase() == Ship::DOCKING ||
- ship->GetFlightPhase() == Ship::DOCKED))
- SetStatus(COMPLETE);
- else if (ship->Integrity() < 1)
- SetStatus(FAILED);
- break;
-
- case DEFEND:
- case ESCORT:
- {
- bool found = false;
- bool safe = true;
-
- ListIter<Element> iter = sim->GetElements();
- while (++iter && !found) {
- Element* e = iter.value();
-
- if (e->IsFinished() || e->IsSquadron())
- continue;
-
- if (e->Name() == tgt_name ||
- (e->GetCommander() && e->GetCommander()->Name() == tgt_name)) {
-
- found = true;
-
- for (int i = 0; i < e->NumShips(); i++) {
- Ship* s = e->GetShip(i+1);
-
- if (s && s->Integrity() < 1)
- SetStatus(FAILED);
- }
-
- if (status == PENDING) {
- // if the element had a flight plan, and all nav points
- // have been addressed, then the element is safe
- if (e->FlightPlanLength() > 0) {
- if (e->GetNextNavPoint() == 0)
- SetStatus(COMPLETE);
- else
- safe = false;
- }
- }
- }
- }
-
- if (status == PENDING && safe &&
- sim->GetPlayerShip() == ship &&
- (ship->GetFlightPhase() == Ship::DOCKING ||
- ship->GetFlightPhase() == Ship::DOCKED)) {
- SetStatus(COMPLETE);
- }
- }
- break;
-
- case PATROL:
- case SWEEP:
- {
- Sim* sim = Sim::GetSim();
- bool alive = false;
-
- ListIter<Element> iter = sim->GetElements();
- while (++iter) {
- Element* e = iter.value();
-
- if (e->IsFinished() || e->IsSquadron())
- continue;
-
- if (e->GetIFF() && e->GetIFF() != ship->GetIFF()) {
- for (int i = 0; i < e->NumShips(); i++) {
- Ship* s = e->GetShip(i+1);
-
- if (s && s->Integrity() >= 1)
- alive = true;
- }
- }
- }
-
- if (status == PENDING && !alive) {
- SetStatus(COMPLETE);
- }
- }
- break;
-
- case INTERCEPT:
- case STRIKE:
- case ASSAULT:
- {
- Sim* sim = Sim::GetSim();
- bool alive = false;
-
- ListIter<Element> iter = sim->GetElements();
- while (++iter) {
- Element* e = iter.value();
-
- if (e->IsFinished() || e->IsSquadron())
- continue;
-
- if (e->Name() == tgt_name) {
- for (int i = 0; i < e->NumShips(); i++) {
- Ship* s = e->GetShip(i+1);
-
- if (s && s->Integrity() >= 1)
- alive = true;
- }
- }
- }
-
- if (status == PENDING && !alive) {
- SetStatus(COMPLETE);
- }
- }
- break;
-
- case RECON:
- break;
-
- default:
- break;
- }
+ Sim* sim = Sim::GetSim();
+
+ switch (action) {
+ case VECTOR:
+ break;
+
+ case LAUNCH:
+ if (ship->GetFlightPhase() == Ship::ACTIVE)
+ SetStatus(COMPLETE);
+ break;
+
+ case DOCK:
+ case RTB:
+ if (sim->GetPlayerShip() == ship &&
+ (ship->GetFlightPhase() == Ship::DOCKING ||
+ ship->GetFlightPhase() == Ship::DOCKED))
+ SetStatus(COMPLETE);
+ else if (ship->Integrity() < 1)
+ SetStatus(FAILED);
+ break;
+
+ case DEFEND:
+ case ESCORT:
+ {
+ bool found = false;
+ bool safe = true;
+
+ ListIter<Element> iter = sim->GetElements();
+ while (++iter && !found) {
+ Element* e = iter.value();
+
+ if (e->IsFinished() || e->IsSquadron())
+ continue;
+
+ if (e->Name() == tgt_name ||
+ (e->GetCommander() && e->GetCommander()->Name() == tgt_name)) {
+
+ found = true;
+
+ for (int i = 0; i < e->NumShips(); i++) {
+ Ship* s = e->GetShip(i+1);
+
+ if (s && s->Integrity() < 1)
+ SetStatus(FAILED);
+ }
+
+ if (status == PENDING) {
+ // if the element had a flight plan, and all nav points
+ // have been addressed, then the element is safe
+ if (e->FlightPlanLength() > 0) {
+ if (e->GetNextNavPoint() == 0)
+ SetStatus(COMPLETE);
+ else
+ safe = false;
+ }
+ }
+ }
+ }
+
+ if (status == PENDING && safe &&
+ sim->GetPlayerShip() == ship &&
+ (ship->GetFlightPhase() == Ship::DOCKING ||
+ ship->GetFlightPhase() == Ship::DOCKED)) {
+ SetStatus(COMPLETE);
+ }
+ }
+ break;
+
+ case PATROL:
+ case SWEEP:
+ {
+ Sim* sim = Sim::GetSim();
+ bool alive = false;
+
+ ListIter<Element> iter = sim->GetElements();
+ while (++iter) {
+ Element* e = iter.value();
+
+ if (e->IsFinished() || e->IsSquadron())
+ continue;
+
+ if (e->GetIFF() && e->GetIFF() != ship->GetIFF()) {
+ for (int i = 0; i < e->NumShips(); i++) {
+ Ship* s = e->GetShip(i+1);
+
+ if (s && s->Integrity() >= 1)
+ alive = true;
+ }
+ }
+ }
+
+ if (status == PENDING && !alive) {
+ SetStatus(COMPLETE);
+ }
+ }
+ break;
+
+ case INTERCEPT:
+ case STRIKE:
+ case ASSAULT:
+ {
+ Sim* sim = Sim::GetSim();
+ bool alive = false;
+
+ ListIter<Element> iter = sim->GetElements();
+ while (++iter) {
+ Element* e = iter.value();
+
+ if (e->IsFinished() || e->IsSquadron())
+ continue;
+
+ if (e->Name() == tgt_name) {
+ for (int i = 0; i < e->NumShips(); i++) {
+ Ship* s = e->GetShip(i+1);
+
+ if (s && s->Integrity() >= 1)
+ alive = true;
+ }
+ }
+ }
+
+ if (status == PENDING && !alive) {
+ SetStatus(COMPLETE);
+ }
+ }
+ break;
+
+ case RECON:
+ break;
+
+ default:
+ break;
+ }
}
void
Instruction::SetStatus(int s)
{
- status = s;
+ status = s;
}
// +----------------------------------------------------------------------+
@@ -336,85 +336,85 @@ Instruction::SetStatus(int s)
const char*
Instruction::GetShortDescription() const
{
- static char desc[256];
-
- switch (action) {
- case VECTOR:
- if (farcast)
- sprintf(desc, Game::GetText("instr.short.farcast").data(), rgn_name.data());
- else
- sprintf(desc, Game::GetText("instr.short.vector").data(), rgn_name.data());
- break;
-
- case LAUNCH:
- sprintf(desc, Game::GetText("instr.short.launch").data(), tgt_name.data());
- break;
-
- case DOCK:
- sprintf(desc, Game::GetText("instr.short.dock").data(), tgt_name.data());
- break;
-
- case RTB:
- sprintf(desc, Game::GetText("instr.short.return-to-base").data());
- break;
-
- case DEFEND:
- if (priority == PRIMARY) {
- sprintf(desc, Game::GetText("instr.short.defend").data(), ActionName(action), tgt_desc.data());
- }
- else {
- sprintf(desc, Game::GetText("instr.short.protect").data(), tgt_desc.data());
- }
- break;
-
- case ESCORT:
- if (priority == PRIMARY) {
- sprintf(desc, Game::GetText("instr.short.escort").data(), ActionName(action), tgt_desc.data());
- }
- else {
- sprintf(desc, Game::GetText("instr.short.protect").data(), tgt_desc.data());
- }
- break;
-
- case PATROL:
- sprintf(desc, Game::GetText("instr.short.patrol").data(),
- tgt_desc.data(),
- rgn_name.data());
- break;
-
- case SWEEP:
- sprintf(desc, Game::GetText("instr.short.sweep").data(),
- tgt_desc.data(),
- rgn_name.data());
- break;
-
- case INTERCEPT:
- sprintf(desc, Game::GetText("instr.short.intercept").data(), tgt_desc.data());
- break;
-
- case STRIKE:
- sprintf(desc, Game::GetText("instr.short.strike").data(), tgt_desc.data());
- break;
-
- case ASSAULT:
- sprintf(desc, Game::GetText("instr.short.assault").data(), tgt_desc.data());
- break;
-
- case RECON:
- sprintf(desc, Game::GetText("instr.short.recon").data(), tgt_desc.data());
- break;
-
- default:
- sprintf(desc, "%s", ActionName(action));
- break;
- }
-
- if (status != PENDING) {
- strcat(desc, " - ");
- strcat(desc, Game::GetText(StatusName(status)));
- }
-
- return desc;
+ static char desc[256];
+
+ switch (action) {
+ case VECTOR:
+ if (farcast)
+ sprintf(desc, Game::GetText("instr.short.farcast").data(), rgn_name.data());
+ else
+ sprintf(desc, Game::GetText("instr.short.vector").data(), rgn_name.data());
+ break;
+
+ case LAUNCH:
+ sprintf(desc, Game::GetText("instr.short.launch").data(), tgt_name.data());
+ break;
+
+ case DOCK:
+ sprintf(desc, Game::GetText("instr.short.dock").data(), tgt_name.data());
+ break;
+
+ case RTB:
+ sprintf(desc, Game::GetText("instr.short.return-to-base").data());
+ break;
+
+ case DEFEND:
+ if (priority == PRIMARY) {
+ sprintf(desc, Game::GetText("instr.short.defend").data(), ActionName(action), tgt_desc.data());
+ }
+ else {
+ sprintf(desc, Game::GetText("instr.short.protect").data(), tgt_desc.data());
+ }
+ break;
+
+ case ESCORT:
+ if (priority == PRIMARY) {
+ sprintf(desc, Game::GetText("instr.short.escort").data(), ActionName(action), tgt_desc.data());
+ }
+ else {
+ sprintf(desc, Game::GetText("instr.short.protect").data(), tgt_desc.data());
+ }
+ break;
+
+ case PATROL:
+ sprintf(desc, Game::GetText("instr.short.patrol").data(),
+ tgt_desc.data(),
+ rgn_name.data());
+ break;
+
+ case SWEEP:
+ sprintf(desc, Game::GetText("instr.short.sweep").data(),
+ tgt_desc.data(),
+ rgn_name.data());
+ break;
+
+ case INTERCEPT:
+ sprintf(desc, Game::GetText("instr.short.intercept").data(), tgt_desc.data());
+ break;
+
+ case STRIKE:
+ sprintf(desc, Game::GetText("instr.short.strike").data(), tgt_desc.data());
+ break;
+
+ case ASSAULT:
+ sprintf(desc, Game::GetText("instr.short.assault").data(), tgt_desc.data());
+ break;
+
+ case RECON:
+ sprintf(desc, Game::GetText("instr.short.recon").data(), tgt_desc.data());
+ break;
+
+ default:
+ sprintf(desc, "%s", ActionName(action));
+ break;
+ }
+
+ if (status != PENDING) {
+ strcat(desc, " - ");
+ strcat(desc, Game::GetText(StatusName(status)));
+ }
+
+ return desc;
}
// +----------------------------------------------------------------------+
@@ -422,85 +422,85 @@ Instruction::GetShortDescription() const
const char*
Instruction::GetDescription() const
{
- static char desc[1024];
-
- switch (action) {
- case VECTOR:
- if (farcast)
- sprintf(desc, Game::GetText("instr.long.farcast").data(), rgn_name.data());
- else
- sprintf(desc, Game::GetText("instr.long.vector").data(), rgn_name.data());
- break;
-
- case LAUNCH:
- sprintf(desc, Game::GetText("instr.long.launch").data(), tgt_name.data());
- break;
-
- case DOCK:
- sprintf(desc, Game::GetText("instr.long.dock").data(), tgt_name.data());
- break;
-
- case RTB:
- sprintf(desc, Game::GetText("instr.long.return-to-base").data());
- break;
-
- case DEFEND:
- if (priority == PRIMARY) {
- sprintf(desc, Game::GetText("instr.long.defend").data(), ActionName(action), tgt_desc.data());
- }
- else {
- sprintf(desc, Game::GetText("instr.long.protect").data(), tgt_desc.data());
- }
- break;
-
- case ESCORT:
- if (priority == PRIMARY) {
- sprintf(desc, Game::GetText("instr.long.escort").data(), ActionName(action), tgt_desc.data());
- }
- else {
- sprintf(desc, Game::GetText("instr.long.protect").data(), tgt_desc.data());
- }
- break;
-
- case PATROL:
- sprintf(desc, Game::GetText("instr.long.patrol").data(),
- tgt_desc.data(),
- rgn_name.data());
- break;
-
- case SWEEP:
- sprintf(desc, Game::GetText("instr.long.sweep").data(),
- tgt_desc.data(),
- rgn_name.data());
- break;
-
- case INTERCEPT:
- sprintf(desc, Game::GetText("instr.long.intercept").data(), tgt_desc.data());
- break;
-
- case STRIKE:
- sprintf(desc, Game::GetText("instr.long.strike").data(), tgt_desc.data());
- break;
-
- case ASSAULT:
- sprintf(desc, Game::GetText("instr.long.assault").data(), tgt_desc.data());
- break;
-
- case RECON:
- sprintf(desc, Game::GetText("instr.long.recon").data(), tgt_desc.data());
- break;
-
- default:
- sprintf(desc, "%s", ActionName(action));
- break;
- }
-
- if (status != PENDING) {
- strcat(desc, " - ");
- strcat(desc, Game::GetText(StatusName(status)));
- }
-
- return desc;
+ static char desc[1024];
+
+ switch (action) {
+ case VECTOR:
+ if (farcast)
+ sprintf(desc, Game::GetText("instr.long.farcast").data(), rgn_name.data());
+ else
+ sprintf(desc, Game::GetText("instr.long.vector").data(), rgn_name.data());
+ break;
+
+ case LAUNCH:
+ sprintf(desc, Game::GetText("instr.long.launch").data(), tgt_name.data());
+ break;
+
+ case DOCK:
+ sprintf(desc, Game::GetText("instr.long.dock").data(), tgt_name.data());
+ break;
+
+ case RTB:
+ sprintf(desc, Game::GetText("instr.long.return-to-base").data());
+ break;
+
+ case DEFEND:
+ if (priority == PRIMARY) {
+ sprintf(desc, Game::GetText("instr.long.defend").data(), ActionName(action), tgt_desc.data());
+ }
+ else {
+ sprintf(desc, Game::GetText("instr.long.protect").data(), tgt_desc.data());
+ }
+ break;
+
+ case ESCORT:
+ if (priority == PRIMARY) {
+ sprintf(desc, Game::GetText("instr.long.escort").data(), ActionName(action), tgt_desc.data());
+ }
+ else {
+ sprintf(desc, Game::GetText("instr.long.protect").data(), tgt_desc.data());
+ }
+ break;
+
+ case PATROL:
+ sprintf(desc, Game::GetText("instr.long.patrol").data(),
+ tgt_desc.data(),
+ rgn_name.data());
+ break;
+
+ case SWEEP:
+ sprintf(desc, Game::GetText("instr.long.sweep").data(),
+ tgt_desc.data(),
+ rgn_name.data());
+ break;
+
+ case INTERCEPT:
+ sprintf(desc, Game::GetText("instr.long.intercept").data(), tgt_desc.data());
+ break;
+
+ case STRIKE:
+ sprintf(desc, Game::GetText("instr.long.strike").data(), tgt_desc.data());
+ break;
+
+ case ASSAULT:
+ sprintf(desc, Game::GetText("instr.long.assault").data(), tgt_desc.data());
+ break;
+
+ case RECON:
+ sprintf(desc, Game::GetText("instr.long.recon").data(), tgt_desc.data());
+ break;
+
+ default:
+ sprintf(desc, "%s", ActionName(action));
+ break;
+ }
+
+ if (status != PENDING) {
+ strcat(desc, " - ");
+ strcat(desc, Game::GetText(StatusName(status)));
+ }
+
+ return desc;
}
// +----------------------------------------------------------------------+
@@ -508,62 +508,62 @@ Instruction::GetDescription() const
const char*
Instruction::ActionName(int a)
{
- switch (a) {
- case VECTOR: return "Vector";
- case LAUNCH: return "Launch";
- case DOCK: return "Dock";
- case RTB: return "RTB";
-
- case DEFEND: return "Defend";
- case ESCORT: return "Escort";
- case PATROL: return "Patrol";
- case SWEEP: return "Sweep";
- case INTERCEPT: return "Intercept";
- case STRIKE: return "Strike";
- case ASSAULT: return "Assault";
- case RECON: return "Recon";
-
- default: return "Unknown";
- }
+ switch (a) {
+ case VECTOR: return "Vector";
+ case LAUNCH: return "Launch";
+ case DOCK: return "Dock";
+ case RTB: return "RTB";
+
+ case DEFEND: return "Defend";
+ case ESCORT: return "Escort";
+ case PATROL: return "Patrol";
+ case SWEEP: return "Sweep";
+ case INTERCEPT: return "Intercept";
+ case STRIKE: return "Strike";
+ case ASSAULT: return "Assault";
+ case RECON: return "Recon";
+
+ default: return "Unknown";
+ }
}
const char*
Instruction::StatusName(int s)
{
- switch (s) {
- case PENDING: return "Pending";
- case ACTIVE: return "Active";
- case SKIPPED: return "Skipped";
- case ABORTED: return "Aborted";
- case FAILED: return "Failed";
- case COMPLETE: return "Complete";
-
- default: return "Unknown";
- }
+ switch (s) {
+ case PENDING: return "Pending";
+ case ACTIVE: return "Active";
+ case SKIPPED: return "Skipped";
+ case ABORTED: return "Aborted";
+ case FAILED: return "Failed";
+ case COMPLETE: return "Complete";
+
+ default: return "Unknown";
+ }
}
const char*
Instruction::FormationName(int f)
{
- switch (f) {
- case DIAMOND: return "Diamond";
- case SPREAD: return "Spread";
- case BOX: return "Box";
- case TRAIL: return "Trail";
-
- default: return "Unknown";
- }
+ switch (f) {
+ case DIAMOND: return "Diamond";
+ case SPREAD: return "Spread";
+ case BOX: return "Box";
+ case TRAIL: return "Trail";
+
+ default: return "Unknown";
+ }
}
const char*
Instruction::PriorityName(int p)
{
- switch (p) {
- case PRIMARY: return "Primary";
- case SECONDARY: return "Secondary";
- case BONUS: return "Bonus";
+ switch (p) {
+ case PRIMARY: return "Primary";
+ case SECONDARY: return "Secondary";
+ case BONUS: return "Bonus";
- default: return "Unknown";
- }
+ default: return "Unknown";
+ }
}