VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
scriptWeaponInfo.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2023 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 #pragma once
6 
7 #include <vrfLua/vrfLuaDefines.h>
8 
10 #include <vlutil/vlString.h>
11 #include <list>
12 #include <luabind/object.hpp>
13 
15 class DtLocalObject;
17 class DtLocation3D;
18 
23  : public DtAsciiSerializable
24 {
25 private:
28 public:
29  DtScriptWeaponInfo(const DtLocalObject* vrfObject);
30 
32 
33  DtScriptWeaponInfo& operator=(const DtScriptWeaponInfo& orig);
34 
35  virtual ~DtScriptWeaponInfo() override;
36 
37  bool operator==(const DtScriptWeaponInfo& orig);
38 
41 
43  bool isValid() const;
44 
45  void setWeaponInfo(const DtString& weaponId, const DtWeaponInfoInterface* weaponInfo);
46  std::string weaponId() const;
47 
48  std::string getDisplayName() const;
49  bool isReady() const;
50  int getStatus() const;
51  std::string getStatusString() const;
52  int getTurret() const;
53  bool getControlExternalTurret() const;
54  std::list<std::string> getFireTasks() const;
55  std::list<std::string> getResourceNames() const;
56  bool canTargetLocation(const DtLocation3D& location) const;
57  double maximumRange() const;
58  double minimumRange() const;
59  int targetApplicability(const std::string& targetType) const;
60  bool targetAmmunition(const std::string& targetType) const;
61  luabind::object createFireTask(lua_State* L, luabind::object const& luaLocationRef) const;
62  bool isAutonomousFire() const;
63  bool isAutonomousFireType(const std::string& targetType) const;
64  luabind::object weaponProperty(lua_State* L, const std::string& propertyName) const;
65  bool isBlockedByOtherWeapon(std::string& blockingWeaponId) const;
66  bool conflictsWithOtherWeapon(const std::string& otherWeaponId) const;
67 
68 
70  virtual DtString serialize() override;
71 
76  virtual void init(const DtSimulationServices*, DtLocalObject* owner);
77 
80  virtual bool deserialize(const DtString& data) override;
81 
82  virtual DtString objectType() const override;
83 
85  //default values
86  static DtAsciiSerializable* creator();
87 
90 
91 protected:
93  void throwIfNotValid() const;
94 
95 protected:
99  std::string myWeaponId;
100 };
101 
103 
104 DT_DLL_vrfLua std::ostream& operator<<(std::ostream&, const DtScriptWeaponInfo&);
const DtLocalObject * myObject
Script API functions. ////////////////////////////////////.
Definition: scriptWeaponInfo.h:97
This class is a wrapper for a DtCompSystem for use by scripts. It derives from DtAsciiSerializable so...
Definition: scriptWeaponInfo.h:22
Definition: asciiSerializable.h:40
virtual bool deserialize(const DtString &)=0
This function should take the string that was serialized via serialize() and fill this object with th...
DT_DLL_terrainCS bool operator==(const DtDegMinSec &lhs, const DtDegMinSec &rhs)
virtual void init(void *userData)
This function is called right after the object is constructed during the deserialization process...
Definition: asciiSerializable.h:78
#define DT_DEFINE_OBJECT_DEBUGGER_NAME(type)
Definition: objectCounter.h:31
DT_DLL_features std::ostream & operator<<(std::ostream &, const DtFeatureTransform &)
std::ostream output.
virtual DtString serialize()=0
The following characters are reserved and cannot be used in serialization: &#39;|&#39;, &#39;:&#39;.
#define DT_DLL_vrfLua
This file is used to determine how to build.
Definition: vrfLuaDefines.h:25
virtual DtString objectType() const =0
Should return the string name of this object. The object name should not be part of the serialization...
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:96
std::string myWeaponId
Script API functions. ////////////////////////////////////.
Definition: scriptWeaponInfo.h:99
Abstract interface class for Weapon Information. This is used by DtWeaponInterfaceList. All code that is accessing information about weapons will have access to this base class only, and only be able to read the data. Weapon controllers will have derived versions that implement key functions for their specific weapon.
Definition: weaponInfoInterface.h:18
const DtWeaponInfoInterface * myWeaponInfo
Script API functions. ////////////////////////////////////.
Definition: scriptWeaponInfo.h:98
A locally simulated VRF object.
Definition: localObject.h:98
const DtSimulationServices * mySimServices
Script API functions. ////////////////////////////////////.
Definition: scriptWeaponInfo.h:96
A location3D is a point in space, i.e. a geocentric coordinate.
Definition: scriptGeometry.h:22

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)