Starshatter_Open
Open source Starshatter engine
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
NetUtil.h
Go to the documentation of this file.
1 /* Project STARSHATTER
2  John DiCamillo
3  Copyright © 1997-2002. All Rights Reserved.
4 
5  SUBSYSTEM: Stars.exe
6  FILE: NetUtil.h
7  AUTHOR: John DiCamillo
8 
9 
10  OVERVIEW
11  ========
12  Utility class to simplify sending NetData messages.
13 */
14 
15 
16 #ifndef NetUtil_h
17 #define NetUtil_h
18 
19 #include "Types.h"
20 #include "Geometry.h"
21 
22 // +-------------------------------------------------------------------+
23 
24 class Element;
25 class Instruction;
26 class SimObject;
27 class Ship;
28 class Shot;
29 class System;
30 class Weapon;
31 
32 // +-------------------------------------------------------------------+
33 
34 class NetUtil
35 {
36 public:
37  static void SendObjDamage(SimObject* obj, double damage, Shot* shot=0);
38  static void SendObjKill(Ship* obj, const Ship* killer, int type=0, int deck=0);
39  static void SendObjHyper(Ship* obj, const char* rgn, const Point& loc, const Ship* fc1=0, const Ship* fc2=0, int ttype=0);
40  static void SendObjTarget(Ship* obj);
41  static void SendObjEmcon(Ship* obj);
42  static void SendSysDamage(Ship* obj, System* sys, double damage);
43  static void SendSysStatus(Ship* obj, System* sys);
44  static void SendWepTrigger(Weapon* wep, int count=1);
45  static void SendWepRelease(Weapon* wep, Shot* shot);
46  static void SendWepDestroy(Shot* shot);
47  static void SendChat(DWORD dst, const char* name, const char* text);
48  static void SendElemRequest(const char* name);
49  static void SendElemCreate(Element* elem, int squadron, int* slots, bool alert, bool in_flight=false);
50  static void SendShipLaunch(Ship* carrier, int squadron, int slot);
51  static void SendNavData(bool add, Element* elem, int index, Instruction* navpt);
52  static void SendNavDelete(Element* elem, int index);
53  static void SendSelfDestruct(Ship* ship, double damage);
54 };
55 
56 #endif NetUtil_h