summaryrefslogtreecommitdiff
path: root/game/shared/tf/tf_xp_source.h
blob: 2d57e8428de0b399c877370c76172a08d8884188 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: Holds XP source data
//
// $NoKeywords: $
//=============================================================================//

#ifndef TF_XP_SOURCE_H
#define TF_XP_SOURCE_H
#ifdef _WIN32
#pragma once
#endif

#include "gcsdk/protobufsharedobject.h"
#include "tf_gcmessages.h"

#ifdef GC
	#include "tf_gc.h"
#endif

//---------------------------------------------------------------------------------
// Purpose: Contains a delta for a player's XP
//---------------------------------------------------------------------------------
class CXPSource : public GCSDK::CProtoBufSharedObject< CMsgTFXPSource, k_EEconTypeXPSource >
{
public:
	CXPSource();
#ifdef GC
	CXPSource( CMsgTFXPSource msg );
	DECLARE_CLASS_MEMPOOL( CXPSource );

	virtual bool BYieldingAddInsertToTransaction( GCSDK::CSQLAccess & sqlAccess );
	virtual bool BYieldingAddWriteToTransaction( GCSDK::CSQLAccess & sqlAccess, const CUtlVector< int > &fields );
	virtual bool BYieldingAddRemoveToTransaction( GCSDK::CSQLAccess & sqlAccess );

	void WriteToRecord( CSchPlayerXPSources *pWarData ) const;
	void ReadFromRecord( const CSchPlayerXPSources & warData );
#endif // GC
};

#endif // TF_XP_SOURCE_H