summaryrefslogtreecommitdiffhomepage
path: root/StarsEx/Ship.h
diff options
context:
space:
mode:
authorAki <please@ignore.pl>2024-03-26 01:45:33 +0100
committerAki <please@ignore.pl>2024-03-26 01:49:16 +0100
commitea4c0557d0b7c2317e03d3d3aaefd6063c99f091 (patch)
treedad4634faf3c17f3642d736f62350df88c117a59 /StarsEx/Ship.h
parent38332f77dc1e7bb03776631101eff6e8ad8bcaef (diff)
downloadstarshatter-ea4c0557d0b7c2317e03d3d3aaefd6063c99f091.zip
starshatter-ea4c0557d0b7c2317e03d3d3aaefd6063c99f091.tar.gz
starshatter-ea4c0557d0b7c2317e03d3d3aaefd6063c99f091.tar.bz2
DWORD replaced with std::uint32_t in non-Win32-related parts
With the exception of some netcode. This brings some important questions and solidifies me in pursuing better abstract over definitions. It might also be a good idea to have distinct aliases or compound types for time and (net) identifiers.
Diffstat (limited to 'StarsEx/Ship.h')
-rw-r--r--StarsEx/Ship.h46
1 files changed, 22 insertions, 24 deletions
diff --git a/StarsEx/Ship.h b/StarsEx/Ship.h
index cdf38bd..2e04cba 100644
--- a/StarsEx/Ship.h
+++ b/StarsEx/Ship.h
@@ -11,15 +11,16 @@
Starship (or space/ground station) class
*/
-#ifndef Ship_h
-#define Ship_h
+#pragma once
+
+#include <cstdint>
+
+#include <List.h>
-#include "Types.h"
#include "SimObject.h"
#include "DetailSet.h"
#include "Director.h"
#include "Geometry.h"
-#include "List.h"
// +--------------------------------------------------------------------+
@@ -150,9 +151,9 @@ public:
virtual void SetNetworkControl(Director* net_ctrl=0);
void SetDirectorInfo(const char* msg) { director_info = msg; }
const char* GetDirectorInfo() const { return director_info; }
- void SetAIMode(int n) { ai_mode = (BYTE) n; }
+ void SetAIMode(int n) { ai_mode = static_cast<std::uint8_t>(n); }
int GetAIMode() const { return (int) ai_mode; }
- void SetCommandAILevel(int n) { command_ai_level = (BYTE) n; }
+ void SetCommandAILevel(int n) { command_ai_level = static_cast<std::uint8_t>(n); }
int GetCommandAILevel() const { return command_ai_level; }
virtual int GetFlightPhase() const { return flight_phase; }
virtual void SetFlightPhase(OP_MODE phase);
@@ -301,7 +302,7 @@ public:
virtual double InflictSystemDamage(double damage, Shot* shot, Point impact);
virtual void InflictNetDamage(double damage, Shot* shot=0);
- virtual void InflictNetSystemDamage(System* system, double damage, BYTE type);
+ virtual void InflictNetSystemDamage(System* system, double damage, std::uint8_t type);
virtual void SetNetSystemStatus(System* system, int status, int power, int reactor, double avail);
virtual void SetIntegrity(float n) { integrity = n; }
@@ -354,7 +355,7 @@ public:
void SetFriendlyFire(int f);
void IncFriendlyFire(int f=1);
double Agility() const { return agility; }
- DWORD MissionClock() const;
+ std::uint32_t MissionClock() const;
Graphic* Cockpit() const;
void ShowCockpit();
void HideCockpit();
@@ -520,19 +521,19 @@ protected:
Vec3 bridge_vec;
const char* director_info;
- BYTE ai_mode;
- BYTE command_ai_level;
- BYTE flcs_mode;
+ std::uint8_t ai_mode;
+ std::uint8_t command_ai_level;
+ std::uint8_t flcs_mode;
bool net_observer_mode;
float pcs; // passive sensor cross section
float acs; // active sensor cross section
- BYTE emcon;
- BYTE old_emcon;
+ std::uint8_t emcon;
+ std::uint8_t old_emcon;
bool invulnerable;
- DWORD launch_time;
- DWORD friendly_fire_time;
+ std::uint32_t launch_time;
+ std::uint32_t friendly_fire_time;
Ship* carrier;
FlightDeck* dock;
@@ -542,7 +543,7 @@ protected:
Point* track;
int ntrack;
- DWORD track_time;
+ std::uint32_t track_time;
float helm_heading;
float helm_pitch;
@@ -560,13 +561,13 @@ protected:
bool master_caution;
bool auto_repair;
- DWORD last_repair_time;
- DWORD last_eval_time;
- DWORD last_beam_time;
- DWORD last_bolt_time;
+ std::uint32_t last_repair_time;
+ std::uint32_t last_eval_time;
+ std::uint32_t last_beam_time;
+ std::uint32_t last_bolt_time;
int missile_id[4];
- BYTE missile_eta[4];
+ std::uint8_t missile_eta[4];
bool trigger[4];
int* loadout;
@@ -577,6 +578,3 @@ protected:
static int landing_model;
static double friendly_fire_level;
};
-
-#endif // Ship_h
-