RigsofRods
Soft-body Physics Simulation
Public Member Functions | Private Attributes
RoR::CmdKeyArray Class Reference

For backwards compatibility of the 'triggers' feature, the commandkey array must support negative indices of any size without breaking memory. More...

#include <SimData.h>

+ Collaboration diagram for RoR::CmdKeyArray:

Public Member Functions

command_toperator[] (int index)
 

Private Attributes

std::array< command_t, MAX_COMMANDS+1 > m_commandkey
 BEWARE: commandkeys are indexed 1-MAX_COMMANDS! More...
 
std::unordered_map< int, command_tm_virtualkey
 Negative-indexed commandkeys. More...
 
command_t m_dummykey
 

Detailed Description

For backwards compatibility of the 'triggers' feature, the commandkey array must support negative indices of any size without breaking memory.

This class redirects the negative-indexed "virtual" commandkeys to auxiliary hashmap.

Definition at line 668 of file SimData.h.

Member Function Documentation

◆ operator[]()

command_t& RoR::CmdKeyArray::operator[] ( int  index)
inline

Definition at line 671 of file SimData.h.

Field Documentation

◆ m_commandkey

std::array<command_t, MAX_COMMANDS + 1> RoR::CmdKeyArray::m_commandkey
private

BEWARE: commandkeys are indexed 1-MAX_COMMANDS!

Definition at line 688 of file SimData.h.

◆ m_dummykey

command_t RoR::CmdKeyArray::m_dummykey
private

Definition at line 690 of file SimData.h.

◆ m_virtualkey

std::unordered_map<int, command_t> RoR::CmdKeyArray::m_virtualkey
private

Negative-indexed commandkeys.

Definition at line 689 of file SimData.h.


The documentation for this class was generated from the following file: