diff options
author | Aki <please@ignore.pl> | 2024-03-26 01:45:33 +0100 |
---|---|---|
committer | Aki <please@ignore.pl> | 2024-03-26 01:49:16 +0100 |
commit | ea4c0557d0b7c2317e03d3d3aaefd6063c99f091 (patch) | |
tree | dad4634faf3c17f3642d736f62350df88c117a59 /StarsEx/NetPlayer.h | |
parent | 38332f77dc1e7bb03776631101eff6e8ad8bcaef (diff) | |
download | starshatter-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/NetPlayer.h')
-rw-r--r-- | StarsEx/NetPlayer.h | 28 |
1 files changed, 12 insertions, 16 deletions
diff --git a/StarsEx/NetPlayer.h b/StarsEx/NetPlayer.h index 143a8be..d79f263 100644 --- a/StarsEx/NetPlayer.h +++ b/StarsEx/NetPlayer.h @@ -11,15 +11,16 @@ Network Player (Director) class */ -#ifndef NetPlayer_h -#define NetPlayer_h +#pragma once + +#include <cstdint> + +#include <List.h> +#include <Text.h> -#include "Types.h" #include "Geometry.h" #include "Director.h" #include "SimObject.h" -#include "List.h" -#include "Text.h" // +--------------------------------------------------------------------+ @@ -44,14 +45,14 @@ class NetPlayer : public Director, public SimObserver public: static const char* TYPENAME() { return "NetPlayer"; } - NetPlayer(DWORD nid) : netid(nid), objid(0), ship(0), iff(0) { } + NetPlayer(std::uint32_t nid) : netid(nid), objid(0), ship(0), iff(0) { } ~NetPlayer(); int operator == (const NetPlayer& p) const { return netid == p.netid; } - DWORD GetNetID() const { return netid; } - DWORD GetObjID() const { return objid; } - void SetObjID(DWORD o) { objid = o; } + std::uint32_t GetNetID() const { return netid; } + std::uint32_t GetObjID() const { return objid; } + void SetObjID(std::uint32_t o) { objid = o; } int GetIFF() const { return iff; } Ship* GetShip() const { return ship; } @@ -80,8 +81,8 @@ public: virtual const char* GetObserverName() const; protected: - DWORD netid; - DWORD objid; + std::uint32_t netid; + std::uint32_t objid; Text name; Text serno; Ship* ship; @@ -90,8 +91,3 @@ protected: Point loc_error; double bleed_time; }; - -// +--------------------------------------------------------------------+ - -#endif // NetPlayer_h - |