Starshatter_Open
Open source Starshatter engine
Main Page
Classes
Files
File List
File Members
All
Classes
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
CombatAssignment.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: CombatAssignment.cpp
7
AUTHOR: John DiCamillo
8
9
10
OVERVIEW
11
========
12
High level assignment of one group to damage another
13
*/
14
15
#include "
MemDebug.h
"
16
#include "
CombatAssignment.h
"
17
#include "
CombatGroup.h
"
18
#include "
Mission.h
"
19
20
// +--------------------------------------------------------------------+
21
22
CombatAssignment::CombatAssignment
(
int
t,
CombatGroup
* obj,
CombatGroup
* rsc)
23
: type(t), objective(obj), resource(rsc)
24
{
25
}
26
27
// +--------------------------------------------------------------------+
28
29
CombatAssignment::~CombatAssignment
()
30
{
31
}
32
33
// +--------------------------------------------------------------------+
34
// This is used to sort assignments into a priority list.
35
// Higher priorities should come first in the list, so the
36
// sense of the operator is "backwards" from the usual.
37
38
int
39
CombatAssignment::operator <
(
const
CombatAssignment
& a)
const
40
{
41
if
(!objective)
42
return
0;
43
44
if
(!a.objective)
45
return
1;
46
47
return
objective->
GetPlanValue
() > a.objective->
GetPlanValue
();
48
}
49
50
// +--------------------------------------------------------------------+
51
52
const
char
*
53
CombatAssignment::GetDescription
()
const
54
{
55
static
char
desc[256];
56
57
if
(!resource)
58
sprintf_s(desc,
"%s %s"
,
59
(
const
char
*)
Mission::RoleName
(type),
60
(
const
char
*) objective->
Name
());
61
else
62
sprintf_s(desc,
"%s %s %s"
,
63
(
const
char
*) resource->
Name
(),
64
(
const
char
*)
Mission::RoleName
(type),
65
(
const
char
*) objective->
Name
());
66
67
return
desc;
68
}
Stars45
CombatAssignment.cpp
Generated on Thu May 31 2012 16:31:04 for Starshatter_Open by
1.8.1