forked from hitmen047/Source-PlusPlus
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtier3dm.h
55 lines (43 loc) · 1.24 KB
/
tier3dm.h
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
49
50
51
52
53
54
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: A higher level link library for general use in the game and tools.
//
//===========================================================================//
#ifndef TIER3DM_H
#define TIER3DM_H
#if defined( _WIN32 )
#pragma once
#endif
#include "tier3/tier3.h"
#include "tier2/tier2dm.h"
//-----------------------------------------------------------------------------
// Helper empty implementation of an IAppSystem for tier2 libraries
//-----------------------------------------------------------------------------
template< class IInterface, int ConVarFlag = 0 >
class CTier3DmAppSystem : public CTier2DmAppSystem< IInterface, ConVarFlag >
{
typedef CTier2DmAppSystem< IInterface, ConVarFlag > BaseClass;
public:
CTier3DmAppSystem( bool bIsPrimaryAppSystem = true ) : BaseClass( bIsPrimaryAppSystem )
{
}
virtual bool Connect( CreateInterfaceFn factory )
{
if ( !BaseClass::Connect( factory ) )
return false;
if ( IsPrimaryAppSystem() )
{
ConnectTier3Libraries( &factory, 1 );
}
return true;
}
virtual void Disconnect()
{
if ( IsPrimaryAppSystem() )
{
DisconnectTier3Libraries();
}
BaseClass::Disconnect();
}
};
#endif // TIER3DM_H