VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
hitZoneId.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2025 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 #pragma once
6 
8 #include <vlutil/vlMachineTypes.h>
9 
11 constexpr DtU8 DtHitZoneFunctionUnspecified = 0;
12 constexpr DtU8 DtHitZoneFunctionWeapon = 1;
13 constexpr DtU8 DtHitZoneFunctionSensor = 2;
14 constexpr DtU8 DtHitZoneFunctionMovement = 3;
15 constexpr DtU8 DtHitZoneFunctionAny = 0xFF;
16 constexpr DtU8 DtHitZoneNumberAny = 0xFF;
17 
22 {
23 public:
24  DtHitZoneId();
25  DtHitZoneId(DtU8 zoneFunction, DtU8 zoneNumber);
27  explicit DtHitZoneId(int packedValue);
28 
29  bool operator==(const DtHitZoneId& rhs) const
30  {
31  return (myZoneFunction == rhs.myZoneFunction) && (myZoneNumber == rhs.myZoneNumber);
32  }
33 
34  bool operator<(const DtHitZoneId& rhs) const
35  {
36  if (myZoneFunction < rhs.myZoneFunction)
37  return true;
38  if (myZoneFunction > rhs.myZoneFunction)
39  return false;
40  return myZoneNumber < rhs.myZoneNumber;
41  }
42 
44  DtU8 zoneFunction() const;
46  void setZoneFunction(DtU8 v);
47 
49  DtU8 zoneNumber() const;
51  void setZoneNumber(DtU8 v);
52 
53 
55  int toInt() const;
57  void setFromInt(int packedValue);
58  static DtHitZoneId fromInt(int packedValue);
59 
60 private:
62  DtU8 myZoneNumber;
63 };
DtU8 myZoneNumber
Definition: hitZoneId.h:62
constexpr DtU8 DtHitZoneNumberAny
Definition: hitZoneId.h:16
constexpr DtU8 DtHitZoneFunctionUnspecified
Definition of zone functions:
Definition: hitZoneId.h:11
constexpr DtU8 DtHitZoneFunctionMovement
Definition: hitZoneId.h:14
bool operator==(const DtHitZoneId &rhs) const
Definition: hitZoneId.h:29
constexpr DtU8 DtHitZoneFunctionAny
Definition: hitZoneId.h:15
ID value for a hit zone. Consists of a zone function (weapon, sensor, movement, etc.) and a zone number. Includes functions for packing/unpacking into an int.
Definition: hitZoneId.h:21
constexpr DtU8 DtHitZoneFunctionSensor
Definition: hitZoneId.h:13
DtU8 myZoneFunction
Definition: hitZoneId.h:61
#define DT_DLL_vrfutil
This file is used to determine how to build Disable inconsistent dll linkage warning Visual Studio 6...
Definition: vrfutilDefines.h:34
constexpr DtU8 DtHitZoneFunctionWeapon
Definition: hitZoneId.h:12
bool operator<(const DtHitZoneId &rhs) const
Definition: hitZoneId.h:34

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)