summaryrefslogtreecommitdiff
path: root/hammer/updatehint.h
blob: cb238fd4c6335880e29c9dd4c7af070bf0615c6e (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
57
58
59
60
61
//========= Copyright Valve Corporation, All rights reserved. ============//
//
// Purpose: 
//
// $NoKeywords: $
//=============================================================================//

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



class CUpdateHint : public CObject
{
	#define MAX_NOTIFY_CODES 16

	struct NotifyList_t
	{
		int nCode;
		CMapObjectList Objects;
	};

	public:

		CUpdateHint(void) {}

		//
		// Called by the code that modifies map objects:
		//
		inline void PreUpdateObject(CMapClass *pObject);
		inline void PreUpdateObjects(CMapObjectList *pObjects);

		inline void PostUpdateObject(CMapClass *pObject, int nNotifyCode);
		inline void PostUpdateObjects(CMapObjectList *pObjects, int nNotifyCode);

		inline BoundBox const &GetUpdateRegion(void);
		inline void Reset(void);
		inline void UpdateBounds(BoundBox &bbox);

		//
		// Called by the document when processing an update:
		//
		inline int GetNotifyCodeCount(void);
		inline int GetNotifyCode(int nIndex);

		inline POSITION GetHeadPosition(int nIndex);
		inline CMapClass *GetNext(int nIndex, POSITION &pos);

	protected:

		NotifyList_t m_NotifyList[MAX_NOTIFY_CODES];	// Lists of objects with common notification codes.
		int m_nListEntries;								// Number of items in the notify list.

		BoundBox m_UpdateRegion;						// 3D map extents that were affected by the change.
};


#endif // UPDATEHINT_H