bool InitInternal()
{
//register config settings
EngineApp.Instance.Config.RegisterClassParameters( typeof( GameControlsManager ) );
//create items
{
int controlKeyCount = 0;
{
foreach( object value in Enum.GetValues( typeof( GameControlKeys ) ) )
{
GameControlKeys controlKey = (GameControlKeys)value;
if( (int)controlKey >= controlKeyCount )
controlKeyCount = (int)controlKey + 1;
}
}
items = new GameControlItem[ controlKeyCount ];
for( int n = 0; n < controlKeyCount; n++ )
{
if( !Enum.IsDefined( typeof( GameControlKeys ), n ) )
{
Log.Fatal( "GameControlsManager: Init: Invalid \"GameControlKeys\" enumeration." );
return false;
}
GameControlKeys controlKey = (GameControlKeys)n;
items[ n ] = new GameControlItem( controlKey );
}
}
//itemsControlKeysDictionary
{
itemsControlKeysDictionary = new Dictionary<GameControlKeys, GameControlItem>();
foreach( GameControlItem item in items )
itemsControlKeysDictionary.Add( item.ControlKey, item );
}
return true;
}