Starshatter_Open
Open source Starshatter engine
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
RadioMessage.h
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: RadioMessage.h
7  AUTHOR: John DiCamillo
8 
9 
10  OVERVIEW
11  ========
12  RadioMessage (radio comms) class declaration
13 */
14 
15 #ifndef RadioMessage_h
16 #define RadioMessage_h
17 
18 #include "Types.h"
19 #include "Geometry.h"
20 #include "SimObject.h"
21 #include "Instruction.h"
22 #include "List.h"
23 #include "Text.h"
24 
25 // +--------------------------------------------------------------------+
26 
27 class Element;
28 class Ship;
29 class SimObject;
30 
31 // +--------------------------------------------------------------------+
32 
34 {
35 public:
36  enum ACTION
37  {
38  NONE = 0,
39 
44 
45  // protocol:
46  ACK,
48 
49  // target mgt:
54 
55  // combat mgt:
59  FORM_UP, // alias for wep_hold
61 
62  // sensor mgt:
67 
68  // formation mgt:
73 
74  // mission mgt:
78 
79  // misc announcements:
88  SPLASH_5, // target destroyed
89  SPLASH_6, // enemy destroyed
90  SPLASH_7, // confirmed kill
95 
96  // friendly fire:
100 
101  // support:
105 
106  // traffic control:
112 
114  };
115 
116  RadioMessage(Ship* dst, const Ship* sender, int action);
117  RadioMessage(Element* dst, const Ship* sender, int action);
118  RadioMessage(const RadioMessage& rm);
119  virtual ~RadioMessage();
120 
121  // accessors:
122  static const char* ActionName(int a);
123 
124  const Ship* Sender() const { return sender; }
125  Ship* DestinationShip() const { return dst_ship; }
126  Element* DestinationElem() const { return dst_elem; }
127  int Action() const { return action; }
129  const Point& Location() const { return location; }
130  const Text& Info() const { return info; }
131  int Channel() const { return channel; }
132 
133  // mutators:
134  void SetDestinationShip(Ship* s) { dst_ship = s; }
136  void AddTarget(SimObject* s);
137  void SetLocation(const Point& l) { location = l; }
138  void SetInfo(Text msg) { info = msg; }
139  void SetChannel(int c) { channel = c; }
140 
141 protected:
142  const Ship* sender;
145  int action;
149  int channel;
150 };
151 
152 // +--------------------------------------------------------------------+
153 
154 #endif RadioMessage_h
155