mirror of
https://github.com/nillerusr/source-engine.git
synced 2026-08-08 01:39:36 +00:00
1
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
//========= Copyright Valve Corporation, All rights reserved. ============//
|
||||
//
|
||||
// Purpose: Code for the CTFMapContribution object
|
||||
//
|
||||
// $NoKeywords: $
|
||||
//=============================================================================//
|
||||
|
||||
#include "cbase.h"
|
||||
|
||||
#include "econ_contribution.h"
|
||||
|
||||
using namespace GCSDK;
|
||||
|
||||
#ifdef GC
|
||||
IMPLEMENT_CLASS_MEMPOOL( CTFMapContribution, 10 * 1000, UTLMEMORYPOOL_GROW_SLOW );
|
||||
|
||||
// memdbgon must be the last include file in a .cpp file!!!
|
||||
#include "tier0/memdbgon.h"
|
||||
|
||||
bool CTFMapContribution::BYieldingAddInsertToTransaction( GCSDK::CSQLAccess & sqlAccess )
|
||||
{
|
||||
CSchMapContribution schMapContribution;
|
||||
WriteToRecord( &schMapContribution );
|
||||
return CSchemaSharedObjectHelper::BYieldingAddInsertToTransaction( sqlAccess, &schMapContribution );
|
||||
}
|
||||
|
||||
bool CTFMapContribution::BYieldingAddWriteToTransaction( GCSDK::CSQLAccess & sqlAccess, const CUtlVector< int > &fields )
|
||||
{
|
||||
CSchMapContribution schMapContribution;
|
||||
WriteToRecord( &schMapContribution );
|
||||
CColumnSet csDatabaseDirty( schMapContribution.GetPSchema()->GetRecordInfo() );
|
||||
csDatabaseDirty.MakeEmpty();
|
||||
if ( fields.HasElement( CSOTFMapContribution::kContributionLevelFieldNumber ) )
|
||||
{
|
||||
csDatabaseDirty.BAddColumn( CSchMapContribution::k_iField_unContributionLevel );
|
||||
}
|
||||
return CSchemaSharedObjectHelper::BYieldingAddWriteToTransaction( sqlAccess, &schMapContribution, csDatabaseDirty );
|
||||
}
|
||||
|
||||
bool CTFMapContribution::BYieldingAddRemoveToTransaction( GCSDK::CSQLAccess & sqlAccess )
|
||||
{
|
||||
CSchMapContribution schMapContribution;
|
||||
WriteToRecord( &schMapContribution );
|
||||
return CSchemaSharedObjectHelper::BYieldingAddRemoveToTransaction( sqlAccess, &schMapContribution );
|
||||
}
|
||||
|
||||
void CTFMapContribution::WriteToRecord( CSchMapContribution *pMapContribution ) const
|
||||
{
|
||||
pMapContribution->m_unAccountID = Obj().account_id();
|
||||
pMapContribution->m_unDefIndex = Obj().def_index();
|
||||
pMapContribution->m_unContributionLevel = Obj().contribution_level();
|
||||
}
|
||||
|
||||
|
||||
void CTFMapContribution::ReadFromRecord( const CSchMapContribution & mapContribution )
|
||||
{
|
||||
Obj().set_account_id( mapContribution.m_unAccountID );
|
||||
Obj().set_def_index( mapContribution.m_unDefIndex );
|
||||
Obj().set_contribution_level( mapContribution.m_unContributionLevel );
|
||||
}
|
||||
|
||||
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user