game/shared/econ/econ_item_schema.cpp
bool CEconItemQualityDefinition::BInitFromKV( KeyValues *pKVQuality, CEconItemSchema &pschema, CUtlVector<CUtlString> *pVecErrors /* = NULL */ )
{

	m_nValue = pKVQuality->GetInt( "value", -1 );
	m_strName = pKVQuality->GetName();	
	m_bCanSupportSet = pKVQuality->GetBool( "canSupportSet" );
	m_strHexColor = pKVQuality->GetString( "hexColor" );
	m_unWeight = pKVQuality->GetInt( "weight", 0 );

	// Check for required fields
	SCHEMA_INIT_CHECK( 
		NULL != pKVQuality->FindKey( "value" ), 
		CFmtStr( "Quality definition %s: Missing required field \"value\"", pKVQuality->GetName() ) );

#if defined(CLIENT_DLL) || defined(GAME_DLL)
	return SCHEMA_INIT_SUCCESS();
#endif

	// Check for data consistency
	SCHEMA_INIT_CHECK( 
		0 != Q_stricmp( GetName(), "any" ), 
		CFmtStr( "Quality definition any: The quality name \"any\" is a reserved keyword and cannot be used." ) );

	SCHEMA_INIT_CHECK( 
		m_nValue != k_unItemQuality_Any, 
		CFmtStr( "Quality definition %s: Invalid value (%d). It is reserved for Any", GetName(), k_unItemQuality_Any ) );

	return SCHEMA_INIT_SUCCESS();
}
//-----------------------------------------------------------------------------
// Purpose:	Initialize the quality definition
// Input:	pKVQuality - The KeyValues representation of the quality
//			schema - The overall item schema for this attribute
//			pVecErrors - An optional vector that will contain error messages if 
//				the init fails.
// Output:	True if initialization succeeded, false otherwise
//-----------------------------------------------------------------------------
Initialize the quality definition
Input: pKVQuality - The KeyValues representation of the quality
schema - The overall item schema for this attribute
pVecErrors - An optional vector that will contain error messages if
the init fails.
Output:        True if initialization succeeded, false otherwise
Initialize the quality definition Input : pKVQuality - The KeyValues representation of the quality schema - The overall item schema for this attribute pVecErrors - An optional vector that will contain error messages if the init fails . Output : True if initialization succeeded false otherwise
bool CEconItemQualityDefinition::BInitFromKV( KeyValues *pKVQuality, CEconItemSchema &pschema, CUtlVector<CUtlString> *pVecErrors  )
{
	m_nValue = pKVQuality->GetInt( "value", -1 );
	m_strName = pKVQuality->GetName();	
	m_bCanSupportSet = pKVQuality->GetBool( "canSupportSet" );
	m_strHexColor = pKVQuality->GetString( "hexColor" );
	m_unWeight = pKVQuality->GetInt( "weight", 0 );
	SCHEMA_INIT_CHECK( 
		NULL != pKVQuality->FindKey( "value" ), 
		CFmtStr( "Quality definition %s: Missing required field \"value\"", pKVQuality->GetName() ) );
#if defined(CLIENT_DLL) || defined(GAME_DLL)
	return SCHEMA_INIT_SUCCESS();
#endif
	SCHEMA_INIT_CHECK( 
		0 != Q_stricmp( GetName(), "any" ), 
		CFmtStr( "Quality definition any: The quality name \"any\" is a reserved keyword and cannot be used." ) );
	SCHEMA_INIT_CHECK( 
		m_nValue != k_unItemQuality_Any, 
		CFmtStr( "Quality definition %s: Invalid value (%d). It is reserved for Any", GetName(), k_unItemQuality_Any ) );
	return SCHEMA_INIT_SUCCESS();
}
bool CEconItemQualityDefinition :: BInitFromKV ( KeyValues * pKVQuality , CEconItemSchema & pschema , CUtlVector < CUtlString > * pVecErrors ) { m_nValue = pKVQuality -> GetInt ( " " , -1 ) ; m_strName = pKVQuality -> GetName ( ) ; m_bCanSupportSet = pKVQuality -> GetBool ( " " ) ; m_strHexColor = pKVQuality -> GetString ( " " ) ; m_unWeight = pKVQuality -> GetInt ( " " , 0 ) ; SCHEMA_INIT_CHECK ( NULL != pKVQuality -> FindKey ( " " ) , CFmtStr ( " \" \" " , pKVQuality -> GetName ( ) ) ) ; #if defined ( CLIENT_DLL ) || defined ( GAME_DLL ) return SCHEMA_INIT_SUCCESS ( ) ; #endif SCHEMA_INIT_CHECK ( 0 != Q_stricmp ( GetName ( ) , " " ) , CFmtStr ( " \" \" " ) ) ; SCHEMA_INIT_CHECK ( m_nValue != k_unItemQuality_Any , CFmtStr ( " " , GetName ( ) , k_unItemQuality_Any ) ) ; return SCHEMA_INIT_SUCCESS ( ) ; }
Purpose:       Initialize the quality definition
Input: pKVQuality - The KeyValues representation of the quality
schema - The overall item schema for this attribute
pVecErrors - An optional vector that will contain error messages if
the init fails.
Purpose : Initialize the quality definition Input : pKVQuality - The KeyValues representation of the quality schema - The overall item schema for this attribute pVecErrors - An optional vector that will contain error messages if the init fails .
/* = NULL */ // Check for required fields // Check for data consistency