VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
fireBallisticGunTask.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2012 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
10 
11 #pragma once
12 
13 #include "vlpi/netStructs.h"
15 #include "vrftasks/simTask.h"
16 #include <readerWriter/rwBoolean.h>
17 #include <readerWriter/rwInt.h>
18 #include <readerWriter/rwReal.h>
19 #include <readerWriter/rwString.h>
21 #include "vrfutil/rwResource.h"
22 #include "vrfutil/rwUUID.h"
23 
28 {
29 
30 public:
32 
35  DtFireBallisticGunTask(const DtString& writeName,
36  DtReaderWriterRegistry* parentRegistry = 0);
37 
39  DtFireBallisticGunTask(const DtString& writeName,
40  const DtFireBallisticGunTask& orig,
41  DtReaderWriterRegistry* parentRegistry = 0);
42 
45 
46  virtual ~DtFireBallisticGunTask() override;
47 
49  virtual const DtSimTaskMessageType& type() const override;
50 
52  virtual DtSimTask* clone(const DtString& name, DtReaderWriterRegistry* parentRegistry = 0) const override;
53 
55  virtual DtString stringRep() const override;
56 
59 
60  virtual DtString weaponId() const;
61  virtual void setWeaponId(const DtString& weaponId);
63 
65 
66  virtual const DtRwLocationReference& target() const;
68 
70  virtual void setTarget(const DtRwLocationReference& target);
72 
75 
76  virtual DtU8 hitZoneFunction() const;
77  virtual void setHitZoneFunction(DtU8 zoneFunction);
79 
82 
83  virtual const int maxRoundsToFire() const;
84  virtual void setMaxRoundsToFire(const int maxRounds);
86 
89 
90  virtual void setAmmoType(const DtEntityType& ammoType);
91  virtual const DtEntityType& ammoType() const;
92  virtual bool ammoTypeSpecified() const;
94 
97  virtual int netRepSize() const override;
98 
100  virtual bool setFromNet(const char* contentBuffer, unsigned contentSize) override;
101 
104  virtual bool setToNet() override;
105 
106  static DtSimTask* creator();
107 
108 protected:
111 
115 
118 
121 
124 };
125 
DtRwInt myMaxRoundsToFire
Max number of rounds that the weapon should fire.
Definition: fireBallisticGunTask.h:120
DtRwResource myAmmoType
The ammunition type to fire, if specified.
Definition: fireBallisticGunTask.h:123
Holds a position of some form. May be an absolute position, or a reference to another object...
Definition: rwLocationReference.h:25
Description: Readable, Writable DtString Variable substitutions are done on this object when it is re...
Definition: rwString.h:20
Definition: readerWriterRegistry.h:39
Contains the DtUUID class declaration.
virtual DtSimTask * clone(const DtString &name, DtReaderWriterRegistry *parentRegistry=0) const =0
Make a copy of this task. Returns a newly allocated instance of a DtSimTask. Override this member fun...
DtRwLocationReference myTarget
Target the weapon that should fire at. It is either a location or an object.
Definition: fireBallisticGunTask.h:114
virtual bool setFromNet(const char *contentBuffer, unsigned contentSize)
Sets mySubtask member from the incoming contentBuffer (cast to type DtNetSimTask). Derived classes should call down to this function first, and then extract their own data starting at the location contentBuffer + DtSimTask::netRepSize().
Description: Readable, Writable int.
Definition: rwInt.h:25
virtual bool setToNet()
Calls netRep() to create the network buffer. Casts the resulting myNetRep to type DtNetSimTask*...
Define constants for types of tasks, sets, admin messages, reports, and sim commands (all sent via ra...
#define DT_DLL_vrftasks
This file is used to determine how to build.
Definition: vrftasksDefines.h:26
DtSimTask is an abstract base class from which real tasks can derive. It manages the read/write capab...
Definition: simTask.h:30
virtual DtString stringRep() const =0
Returns a human-readable string representation of the task. This string representation is used to dis...
const DtSimTask & operator=(const DtSimTask &orig)
assignment operator; same as copy constructor
Task for firing the ballistic gun at a target.
Definition: fireBallisticGunTask.h:27
DtRwString myWeaponId
Weapon ID string for the weapon that should be used.
Definition: fireBallisticGunTask.h:110
virtual const DtSimTaskMessageType & type() const =0
What kind of task am I? Returns a string indicating the kind of task (for example, “move-to”, “follow-entity”). Derived classes must implement this member function to return a unique string representing the type of task. The set of standard task types supplied with VR-Forces is in taskTypes.h.
This class will read in an old resource by name and convert it to the type, or, just read it as type...
Definition: rwResource.h:12
virtual int netRepSize() const
Returns the size in bytes of the network representation of the class. This is the size in bytes of th...
DtRwInt myHitZoneFunction
The target hit zone function (e.g. weapon, sensor, movement).
Definition: fireBallisticGunTask.h:117

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)