5#include <unordered_map>
27 mControlDeck = std::move(controlDeck);
33 ControllerRumble(uint8_t portIndex, std::shared_ptr<ConsoleVariable> consoleVariable =
nullptr,
34 std::shared_ptr<ControlDeck> controlDeck =
nullptr);
107 std::unordered_map<std::string, std::shared_ptr<ControllerRumbleMapping>> mRumbleMappings;
108 std::shared_ptr<ConsoleVariable> mConsoleVariable;
109 std::shared_ptr<ControlDeck> mControlDeck;
Aggregates rumble output mappings and drives force-feedback hardware.
Definition ControllerRumble.h:23
void StartRumble()
Activates rumble on all mapped physical devices.
bool HasMappingsForPhysicalDeviceType(PhysicalDeviceType physicalDeviceType)
Returns true if any mapping targets the given device type.
void ClearRumbleMappingId(std::string id)
Removes the mapping ID from Config without destroying the in-memory object.
void LoadRumbleMappingFromConfig(std::string id)
Loads the mapping with id from Config and adds it to the collection.
void ReloadAllMappingsFromConfig()
Clears all in-memory mappings and reloads them from Config.
ControllerRumble(uint8_t portIndex, std::shared_ptr< ConsoleVariable > consoleVariable=nullptr, std::shared_ptr< ControlDeck > controlDeck=nullptr)
Constructs a ControllerRumble for the given port.
void SaveRumbleMappingIdsToConfig()
Writes the current set of mapping IDs to Config.
void ClearAllMappings()
Removes all in-memory rumble mappings.
void AddDefaultMappings(PhysicalDeviceType physicalDeviceType)
Applies the default rumble mappings for the given device type.
void AddRumbleMapping(std::shared_ptr< ControllerRumbleMapping > mapping)
Adds a rumble mapping to the collection.
void ClearAllMappingsForDeviceType(PhysicalDeviceType physicalDeviceType)
Removes all mappings that target the given device type.
void ClearRumbleMapping(std::string id)
Removes the mapping with id from both in-memory and Config.
bool AddRumbleMappingFromRawPress()
Listens for the next raw physical input and creates a rumble mapping from it.
void SetControlDeck(std::shared_ptr< ControlDeck > controlDeck)
Injects the owning ControlDeck.
Definition ControllerRumble.h:26
std::unordered_map< std::string, std::shared_ptr< ControllerRumbleMapping > > GetAllRumbleMappings()
Returns a copy of the full id → mapping map.
void StopRumble()
Stops rumble on all mapped physical devices.
Core namespace for the libultraship engine framework.
Definition gfx_direct3d_common.h:14
PhysicalDeviceType
Identifies the category of a physical input device.
Definition PhysicalDeviceType.h:11