OpenBarnyard
 
Loading...
Searching...
No Matches
AInputMap.cpp
Go to the documentation of this file.
1#include "pch.h"
2#include "AInputMap.h"
3#include "AInputMapManager.h"
4
5//-----------------------------------------------------------------------------
6// Enables memory debugging.
7// Note: Should be the last include!
8//-----------------------------------------------------------------------------
10
12
13void AInputMap::LoadFromProperties( const PBProperties& a_rProperties )
14{
15 m_oDoodadToCommandMap.Clear();
16
17 auto pInputManager = AInputMapManager::GetSingleton();
18
19 for ( auto it = a_rProperties.Begin(); it != a_rProperties.End(); it++ )
20 {
21 auto eCommandCode = pInputManager->GetCommandCode( Toshi::TPString8( it->GetName().GetString() ) );
22 auto pArray = it->GetValue()->GetArray();
23
24 for ( TUINT i = 0; i < pArray->GetSize(); i++ )
25 {
26 auto pValue = pArray->GetValue( i );
27 auto iDoodad = pInputManager->GetDoodadFromKey( pValue->GetTPString8() );
28
29 m_oDoodadToCommandMap.Insert( iDoodad, eCommandCode );
30 }
31 }
32}
#define TDEFINE_CLASS_NORUNTIME(...)
Definition TObject.h:138
unsigned int TUINT
Definition Typedefs.h:8
PBProperty * Begin()
PBProperty * End()
void LoadFromProperties(const PBProperties &a_rProperties)
Definition AInputMap.cpp:13
AInputMap(const Toshi::TPString8 &a_rName)
Definition AInputMap.h:102