summaryrefslogtreecommitdiff
path: root/game/client/tf/tf_shared_content_manager.h
blob: f2bec312a048eeab6f0b32a6f10b01e02c42614e (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
42
43
44
45
46
47
48
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: Generic in-game abuse reporting
//
// $NoKeywords: $
//=============================================================================//

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

typedef struct 
{
	int iFlag;
	uint32 unAccountID;
} shared_vision_entry_t;

// Shared content manager
class C_TFSharedContentManager : public CBaseGameSystemPerFrame
{
public:
	C_TFSharedContentManager(){}

	void OfferSharedVision( int iFlag, uint32 unAccountID );
	bool IsSharedVisionAvailable( int iFlag ){ return ( m_iSharedVisionFlags & iFlag ); }

	// Methods of IGameSystem
	virtual char const *Name() { return "C_TFSharedContentManager"; }
	virtual bool Init();
	virtual void Update( float frametime );

private:
	bool CanOfferVision( int iFlag );
	void AddSharedVision( int iFlag ){ m_iSharedVisionFlags |= iFlag; }
	void OfferSharedVision_Internal( int iFlag, uint32 unAccountID );
	void PrintChatText( int iFlag, uint32 unAccountID );

private:
	int m_iSharedVisionFlags;
	CUtlVector< uint32 > m_PlayersWhoHaveOfferedVision;	// needs to be expanded when we offer more than Romevision...
	CUtlVector< shared_vision_entry_t > m_SharedVisionQueue;
};

extern C_TFSharedContentManager *TFSharedContentManager();	// get singleton

#endif	// TF_SHARED_CONTENT_MANAGER_H