VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
resourceListCommandSpecParam.h
Go to the documentation of this file.
1 /******************************************************************************
2  * Copyright (c) 2026 MAK Technologies, Inc.
3  * All rights reserved.
4  ******************************************************************************/
5 
6 #pragma once
7 
8 #include "commandSpecJob.h"
9 #include <atomic>
10 #include <set>
12 #include <json/json.h>
13 #include <boost/signals2/connection.hpp>
14 
15 class DtScenarioManager;
16 
24 {
25 public:
26  // describes what kind of resource we are looking for
27  enum class RequestType
28  {
30  Bombs,
31  };
32 
33  explicit DtResourceListCommandSpecParamBuilder(const RequestType& type, const Json::Value& staticParams,
34  const std::string& entityName, DtScenarioManager& scnMgr, const Json::Value& typeModifiers);
36 
37 protected:
38  virtual void addResource(const DtSimResource&) override;
39  virtual void resourceCheckComplete() override;
40 
41  virtual bool isCorrectResourceType(const DtSimResource& resource);
42  virtual bool isCounterMeasure(const DtSimResource& resource) const;
43  virtual bool getGuidingTarget(std::string& target) const;
44  virtual bool resourceMatchesGuiding(const DtEntityType& type, const bool target) const;
45  virtual bool isBomb(const DtSimResource& resource);
46  virtual void loadBombs();
47 
48  virtual void resourcesChanged() {};
49  virtual void resourceCheckingDisabled() {};
50  virtual void resourceUpdated(const DtSimResource&) {};
51 
52  virtual bool isReady() const override { return myReady; }
53  virtual Json::Value result() const override { return myResult; }
54 
55 private:
59  std::atomic<bool> myReady;
63 
64  // lazily loaded bomb definitions, mirrors GUI
65  std::set<DtEntityType> bombTypes;
66 };
UUID is a unique ID wrapper class.
Definition: uuid.h:59
Definition: scenarioManager.h:40
Json::Value myTypeModifiers
Definition: resourceListCommandSpecParam.h:60
RequestType
Definition: resourceListCommandSpecParam.h:27
Json::Value myChoices
Definition: resourceListCommandSpecParam.h:57
DtScenarioManager & myScnMgr
Definition: resourceListCommandSpecParam.h:61
std::atomic< bool > myReady
Definition: resourceListCommandSpecParam.h:59
virtual void resourcesChanged()
Virtual overrides to complete class.
Definition: resourceListCommandSpecParam.h:48
DtResourceListCommandSpecParamBuilder.
Definition: resourceListCommandSpecParam.h:23
virtual void resourceCheckingDisabled()
Called when this item can not longer set resources. This will happen when multiple requests are made ...
Definition: resourceListCommandSpecParam.h:49
std::set< DtEntityType > bombTypes
Definition: resourceListCommandSpecParam.h:65
virtual Json::Value result() const override
Returns the fully populated JSON descriptor for this parameter. Only valid after isReady() returns tr...
Definition: resourceListCommandSpecParam.h:53
virtual bool isCorrectResourceType(const DtSimResource &resource)
DtResourceListCommandSpecParamBuilder(const RequestType &type, const Json::Value &staticParams, const std::string &entityName, DtScenarioManager &scnMgr, const Json::Value &typeModifiers)
virtual bool isBomb(const DtSimResource &resource)
Awaitable result handle for asynchronous command spec building.
virtual bool getGuidingTarget(std::string &target) const
IMGUI_API void Value(const char *prefix, bool b)
Abstract base for a single-parameter command spec builder.
Definition: commandSpecParamBuilder.h:25
RequestType myRequestType
Definition: resourceListCommandSpecParam.h:62
The class that is the interface between the GUI and the back-end.
Definition: remoteControlResourceRequestor.h:33
DtSimResource is a class which will define a SISO Enumeration to use as a resource and the quantity o...
Definition: simResource.h:32
virtual bool isReady() const override
Returns true once result() can be safely called.
Definition: resourceListCommandSpecParam.h:52
virtual void resourceUpdated(const DtSimResource &)
Called when a particular resource has been updated.
Definition: resourceListCommandSpecParam.h:50
Json::Value myResult
Definition: resourceListCommandSpecParam.h:56
virtual void resourceCheckComplete() override
Called when resource checking is complete.
virtual bool resourceMatchesGuiding(const DtEntityType &type, const bool target) const
DtUUID myEntityUuid
Definition: resourceListCommandSpecParam.h:58
virtual void addResource(const DtSimResource &) override
Called to add a new resource.
virtual bool isCounterMeasure(const DtSimResource &resource) const

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)