73 virtual void tick(
double dt)
override;
81 virtual const char*
type()
const override;
119 virtual bool doesHandItemMatch(
const std::string& vrfResourceName,
const std::string& handItem);
130 template <
typename T>
131 T
lookUpField(std::string resource,
const std::string& field, T defaultValue);
176 return resourceEntry.
findData<T>(field);
181 LOG_DEBUG(
"Resource monitor") <<
"Could not find " << field <<
" for VRF resource: " << resource << std::endl;
Scoped attribute change callback wrapper.
Definition attributeCallback.h:86
Handle class for safe access to attributes.
Definition attributeHandle.h:30
Type-specific handle class for attributes.
Definition attributeHandle.h:181
Table-based access to Lua state for configuration data.
Definition initializer.h:38
RT findData(const std::string &name, bool resolveDots=true)
Definition initializer.h:175
virtual bool hasField(const std::string &name, bool resolveDots=true)
Checks if the table has a field with the given name.
virtual DtPlayerStation & player()
Gets the player station.
DtPlayerComponent()
Constructor.
Class for managing the user interface for engaged roles.
Definition playerStation.h:51
Abstract base class for all VREngage messages.
Definition vreMessage.h:50
T lookUpField(std::string resource, const std::string &field, T defaultValue)
Looks up a field value for a resource in the resource mappings table.
Definition weaponResourceLogic.h:158
virtual void tick(double dt) override
Called every frame to update component state.
virtual ~DtWeaponResourceLogic() override
Virtual destructor for DtWeaponResourceLogic.
virtual makVre::DtVreMessageResult handleResourceUpdate(makVre::DtVreMessage *msg)
Handles resource update.
DtAttributeHandleType< std::vector< std::string > > myResourceStore
Definition weaponResourceLogic.h:150
DtAttributeChangeCallback myResourceCallback
Definition weaponResourceLogic.h:152
virtual const char * type() const override
Returns the type identifier for this component.
virtual bool doesHandItemMatch(const std::string &vrfResourceName, const std::string &handItem)
Checks if a hand item matches a resource.
virtual void addWeaponToList(const std::string &resource)
DtInitTable myResourceMappings
Configuration table containing resource mappings.
Definition weaponResourceLogic.h:148
DtWeaponResourceLogic()
Constructor for DtWeaponResourceLogic.
virtual void removeWeaponFromList(const std::string &resource)
virtual std::string lookUpDiguyHandItem(const std::string &vrfResourceName)
Looks up the diguy hand item for a resource.
virtual std::string lookUpResourceByDeployedEquipment(const DtEntityType &equipmentType)
Finds a resource name by matching against an entity type.
virtual bool postInitialize() override
Performs post-initialization after all components are initialized.
virtual bool initialize(makVre::DtPlayerStation *player, makVre::DtInitTable &config) override
Initializes the weapon resource logic component.
virtual std::string lookUpShortName(const std::string &vrfResourceName)
Looks up the human-readable short name for a resource.
virtual void resourceChanged(const DtAttributeHandle &changed)
virtual void shutdown() override
Shuts down the weapon resource logic component.
virtual std::vector< std::string > resourceMappingKeys()
Gets a list of all resource mappings keys.
constexpr const char * resourceMappings
Definition weaponResourceLogic.h:30
Defines export/import macros for the vreCommonComponents library.
#define VRECOMMONCOMPONENTS_DLL
DLL export/import macro for the vreCommonComponents library.
Definition export.h:28
#define LOG_DEBUG(channel)
Macro to log a debug message to log files.
Definition logger.h:84
Definition weaponResourceLogic.h:22
Include export definitions for this library.
Definition glsVreMessageUtil.h:49
constexpr const char * DtWeaponResourceLogicType
Type identifier for DtWeaponResourceLogic component.
Definition weaponResourceLogic.h:36
DtVreMessageResult
Enumeration of possible message handling results.
Definition vreMessage.h:33
Defines the DtPlayerComponent base class for VR-Engage role components.
Defines the base class for all VREngage messages.