-
Notifications
You must be signed in to change notification settings - Fork 0
/
IGCMap.h
178 lines (165 loc) · 4.03 KB
/
IGCMap.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
#include <afxtempl.h>
#include <corestruct.h>
#include "mapstruct.h"
#pragma once
#include "RockTpl.h"
enum IGCObjType {igcAleph,igcBase,igcRock};
class CIGCObject // abstract class, (3 pure virtual)
{
public:
virtual CPoint GetPos2D() = 0;
virtual void SetPos2D(CPoint) = 0;
virtual void ApplyPos3D(float,float,float) = 0;
virtual IGCObjType GetType() = 0;
virtual float GetX() = 0;
virtual float GetY() = 0;
virtual float GetZ() = 0;
virtual void SetZ(float) = 0;
void DispMenu(CPoint,CWnd * pParent);
CIGCObject(void);
~CIGCObject(void);
virtual int DispProps(CWnd * pParent,PtrCore, CString) = 0;
int DistanceToCenter(float,float);
};
class CIGCBase : public CIGCObject
{
public:
SIGCBase igcbase;
CPoint GetPos2D();
void SetPos2D(CPoint);
void ApplyPos3D(float,float,float);
IGCObjType GetType();
float GetX();
float GetY();
float GetZ();
void SetZ(float);
int DispProps(CWnd * pParent,PtrCore,CString);
CPoint pos2D;
private:
static const IGCObjType type = igcBase;
public:
CIGCBase(void);
~CIGCBase(void);
};
class CIGCAleph : public CIGCObject
{
public:
SIGCAleph igcaleph;
CPoint GetPos2D();
void SetPos2D(CPoint);
void ApplyPos3D(float,float,float);
IGCObjType GetType();
float GetX();
float GetY();
float GetZ();
void SetZ(float);
int DispProps(CWnd * pParent,PtrCore, CString);
CPoint pos2D;
private:
static const IGCObjType type = igcAleph;
public:
CIGCAleph(void);
~CIGCAleph(void);
void OrientTo(void);
BOOL bAutoOrient;
BOOL bNoSpin;
BOOL bIncludeSpin;
void AutoAuto(void);
void RandomPosition(float);
void RandomPosition(float,float,float);
void StdRandomPosition();
void ApplyTemplate(CIGCAleph * tplaleph,bool);
void CloneFrom(CIGCAleph * tplaleph);
};
class CIGCRock : public CIGCObject
{
public:
SIGCRock igcrock;
CPoint GetPos2D();
void SetPos2D(CPoint);
void ApplyPos3D(float,float,float);
IGCObjType GetType();
float GetX();
float GetY();
float GetZ();
void SetZ(float);
int DispProps(CWnd * pParent,PtrCore, CString);
CPoint pos2D;
private:
static const IGCObjType type = igcRock;
public:
CIGCRock(void);
CIGCRock(int tpl,unsigned short uid,CRockTpl *);
~CIGCRock(void);
void FixSpin(void);
void RandomSpin(void);
void RandomOrientation(void);
void RandomPosition(void);
void SetAutoName(bool);
void ApplyTemplate(CRockTpl *);
};
class CIGCSector
{
public:
SIGCSector igcsector;
CPoint pos2D;
int lbindex;
public:
CIGCSector(void);
void RandomizeAlephs(CList <CIGCAleph,CIGCAleph&> *);
void RandomizeAlephs(CList <CIGCAleph,CIGCAleph&> *,int,int,int,float,float,bool,bool);
void ApplyTemplate(CIGCSector *,bool);
~CIGCSector(void);
};
//overload ==
int operator==(const CIGCSector,const CIGCSector);
int operator!=(const CIGCSector,const CIGCSector);
int operator==(const CIGCAleph,const CIGCAleph);
int operator!=(const CIGCAleph,const CIGCAleph);
int operator==(const CIGCBase,const CIGCBase);
int operator!=(const CIGCBase,const CIGCBase);
int operator==(const CIGCRock,const CIGCRock);
int operator!=(const CIGCRock,const CIGCRock);
typedef struct SSectorInfos
{
float he3;
float he3max;
int nbHelium;
int nbAsteriod;
int nbUranium;
int nbSilicon;
int nbCarbon;
} SectorInfos;
typedef CIGCSector *PtrSector;
typedef CIGCAleph *PtrAleph;
typedef CIGCBase *PtrBase;
typedef CIGCRock *PtrRock;
typedef CIGCObject *PtrObject;
class CIGCMap
{
public:
CString name;
CList <CIGCSector,CIGCSector&> cl_sectors;
CList <CIGCBase,CIGCBase&> cl_bases;
CList <CIGCAleph,CIGCAleph&> cl_alephs;
CList <CIGCRock,CIGCRock&> cl_rocks;
public:
CIGCMap(void);
~CIGCMap(void);
PtrCore pcore;
BOOL CIGCMap::SaveToFile(CString);
BOOL ReadFromFile(CString);
CString DumpSectors(void);
CString DumpRocks(void);
CString CheckValidity(void);
PtrSector FindSector(unsigned short);
PtrAleph FindConnectingAleph(PtrAleph);
void RandomizeAlephs(void);
void RandomizeAlephs(float r);
void RandomizeAlephs(float r1,float r2,float z);
void RandomizeAlephs(int p1,int p2,int p3,float p4,float p5, bool, bool);
void RenameAlephs(CIGCSector *psect);
int RenameSectors(CString);
protected:
void FixUIDs(void);
};