summaryrefslogtreecommitdiff
path: root/hammer/mapgroup.h
blob: 4a3626697dfae465a4f04f2dc810f74beca6df85 (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
49
50
51
52
53
54
55
56
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//
//===========================================================================//

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

#include "MapDefs.h"
#include "MapClass.h"


class CMapGroup : public CMapClass
{
	public:
		DECLARE_MAPCLASS(CMapGroup,CMapClass)
		
		CMapGroup() : m_vecLogicalPosition(COORD_NOTINIT, COORD_NOTINIT) {}

		const char* GetDescription(void);

		virtual CMapClass *Copy(bool bUpdateDependencies);
		virtual CMapClass *CopyFrom(CMapClass *pFrom, bool bUpdateDependencies);

		virtual bool IsGroup(void) { return true; }

		// Groups have to be treated as logical because they potentially have logical children
		virtual bool IsLogical(void) { return true; }
		virtual bool IsVisibleLogical(void) { return IsVisible(); }

		void AddChild(CMapClass *pChild);
		void AddVisGroup(CVisGroup *pVisGroup);

		// NOTE: Logical position is in global space
		virtual void SetLogicalPosition( const Vector2D &vecPosition );
		virtual const Vector2D& GetLogicalPosition( );
		virtual void GetRenderLogicalBox( Vector2D &mins, Vector2D &maxs );

		//
		// Serialization.
		//
		ChunkFileResult_t LoadVMF(CChunkFile *pFile);
		ChunkFileResult_t SaveVMF(CChunkFile *pFile, CSaveInfo *pSaveInfo);

 		Vector2D m_vecLogicalPosition;	// Position in logical space
};


typedef CUtlVector<CMapGroup *> CMapGroupList;


#endif // MAPGROUP_H