forked from Corran-Raisu/FLCompanion
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockable.h
57 lines (46 loc) · 1.25 KB
/
Dockable.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
55
56
57
// Dockable.h: interface for the CDockable class.
//
//////////////////////////////////////////////////////////////////////
#if !defined(AFX_DOCKABLE_H__40002BD2_0BAB_4670_9019_4B66859BF2E4__INCLUDED_)
#define AFX_DOCKABLE_H__40002BD2_0BAB_4670_9019_4B66859BF2E4__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include <math.h>
#define BASES_MAX 3072
extern UINT BASES_COUNT;
#define MAPMAX 131072
class CSystem;
typedef struct tagPOS3D
{
LONG x;
LONG y;
LONG z;
} POS3D;
inline UINT Distance(POS3D &p1, POS3D &p2)
{
double dx = p2.x-p1.x;
double dy = p2.y-p1.y;
double dz = p2.z-p1.z;
return (UINT) sqrt(dx*dx+dy*dy+dz*dz);
}
class CDockable
{
public:
CDockable() : m_system(NULL) {}
~CDockable() {}
public:
void ResetPath();
void Init(const CString &nickname, const CString &caption, CSystem *system);
void SetPos(int x, int y, int z = 0) { m_pos.x = x; m_pos.y = y; m_pos.z = z; }
virtual CString LetterPos();
public:
void Draw(CDC &dc, COLORREF color, BOOL displayNicknames);
CSystem *m_system;
CString m_caption;
CString m_nickname;
UINT m_distanceToBase[BASES_MAX];
CDockable *m_shortestPath[BASES_MAX];
POS3D m_pos;
};
#endif // !defined(AFX_DOCKABLE_H__40002BD2_0BAB_4670_9019_4B66859BF2E4__INCLUDED_)