mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-11-27 14:37:16 +00:00
used enum for geometry classes; moved from hyper.h to init.cpp
This commit is contained in:
parent
540f0678ee
commit
dbcd71cb45
28
classes.cpp
28
classes.cpp
@ -1607,19 +1607,19 @@ vector<eLand> randlands = {
|
||||
};
|
||||
|
||||
geometryinfo ginf[gGUARD] = {
|
||||
{"standard", "HR", 7, 3, 0, 0, {{7, 5}}},
|
||||
{"Euclidean", "euclid", 6, 3, 0, 1, {{7, FORBIDDEN}}},
|
||||
{"spherical", "sphere", 5, 3, 0, 2, {{SEE_ALL, SEE_ALL}}},
|
||||
{"elliptic", "elliptic", 5, 3, qELLIP, 2, {{SEE_ALL, SEE_ALL}}},
|
||||
{"Zebra quotient", "Zebra", 7, 3, qZEBRA, 0, {{7, 5}}},
|
||||
{"field quotient", "field", 7, 3, qFIELD, 0, {{7, 5}}},
|
||||
{"torus", "torus", 6, 3, qTORUS, 1, {{7, FORBIDDEN}}},
|
||||
{"octagons", "oct", 8, 3, 0, 0, {{6, 4}}},
|
||||
{"four pentagons", "4x5", 5, 4, 0, 0, {{6, 4}}},
|
||||
{"four hexagons", "4x6", 6, 4, 0, 0, {{5, 3}}},
|
||||
{"four heptagons", "4x7", 7, 4, 0, 0, {{4, 3}}},
|
||||
{"cube", "3x4", 4, 3, 0, 2, {{SEE_ALL, SEE_ALL}}},
|
||||
{"tetrahedron (buggy)", "3x3", 3, 3, 0, 2, {{SEE_ALL, SEE_ALL}}},
|
||||
{"square grid", "4x4", 4, 4, 0, 1, {{7, 7}}}
|
||||
{"standard", "HR", 7, 3, 0, gcHyperbolic, {{7, 5}}},
|
||||
{"Euclidean", "euclid", 6, 3, 0, gcEuclid, {{7, FORBIDDEN}}},
|
||||
{"spherical", "sphere", 5, 3, 0, gcSphere, {{SEE_ALL, SEE_ALL}}},
|
||||
{"elliptic", "elliptic", 5, 3, qELLIP, gcSphere, {{SEE_ALL, SEE_ALL}}},
|
||||
{"Zebra quotient", "Zebra", 7, 3, qZEBRA, gcHyperbolic, {{7, 5}}},
|
||||
{"field quotient", "field", 7, 3, qFIELD, gcHyperbolic, {{7, 5}}},
|
||||
{"torus", "torus", 6, 3, qTORUS, gcEuclid, {{7, FORBIDDEN}}},
|
||||
{"octagons", "oct", 8, 3, 0, gcHyperbolic, {{6, 4}}},
|
||||
{"four pentagons", "4x5", 5, 4, 0, gcHyperbolic, {{6, 4}}},
|
||||
{"four hexagons", "4x6", 6, 4, 0, gcHyperbolic, {{5, 3}}},
|
||||
{"four heptagons", "4x7", 7, 4, 0, gcHyperbolic, {{4, 3}}},
|
||||
{"cube", "3x4", 4, 3, 0, gcSphere, {{SEE_ALL, SEE_ALL}}},
|
||||
{"tetrahedron (buggy)", "3x3", 3, 3, 0, gcSphere, {{SEE_ALL, SEE_ALL}}},
|
||||
{"square grid", "4x4", 4, 4, 0, gcEuclid, {{7, 7}}}
|
||||
};
|
||||
|
||||
|
@ -189,13 +189,15 @@ enum eLand { laNone, laBarrier, laCrossroads, laDesert, laIce, laCaves, laJungle
|
||||
|
||||
enum eGeometry {gNormal, gEuclid, gSphere, gElliptic, gQuotient, gQuotient2, gTorus, gOctagon, g45, g46, g47, gSmallSphere, gTinySphere, gEuclidSquare, gGUARD};
|
||||
|
||||
enum eGeometryClass { gcHyperbolic, gcEuclid, gcSphere };
|
||||
|
||||
struct geometryinfo {
|
||||
const char* name;
|
||||
const char* shortname;
|
||||
int sides;
|
||||
int vertex;
|
||||
int quotientstyle;
|
||||
int cclass; // 0-hyperbolic, 1-Euclidean, 2-spherical
|
||||
eGeometryClass cclass;
|
||||
array<int,2> distlimit; // truncated, non-truncated
|
||||
};
|
||||
|
||||
|
9
hyper.h
9
hyper.h
@ -2077,15 +2077,6 @@ int celldistAlt(cell *c);
|
||||
int celldist(cell *c);
|
||||
int getHemisphere(cell *c, int which);
|
||||
|
||||
#define euclid (ginf[geometry].cclass == 1)
|
||||
#define sphere (ginf[geometry].cclass == 2)
|
||||
#define elliptic (ginf[geometry].quotientstyle & 4)
|
||||
#define quotient (ginf[geometry].quotientstyle & 3)
|
||||
#define torus (ginf[geometry].quotientstyle & 8)
|
||||
#define doall (ginf[geometry].quotientstyle)
|
||||
#define smallbounded (sphere || quotient == 1 || torus)
|
||||
#define bounded (sphere || quotient || torus)
|
||||
|
||||
namespace tactic {
|
||||
extern bool on;
|
||||
extern bool trailer;
|
||||
|
11
init.cpp
11
init.cpp
@ -356,6 +356,17 @@ void addMessage(string s, char spamtype = 0);
|
||||
#define weirdhyperbolic (S7 > 7 || S3 > 3)
|
||||
#define stdhyperbolic (S7 == 7 && S3 == 3)
|
||||
|
||||
#define cgclass (ginf[geometry].cclass)
|
||||
#define euclid (cgclass == gcEuclid)
|
||||
#define sphere (cgclass == gcSphere)
|
||||
#define hyperbolic (cgclass == gcHyperbolic)
|
||||
#define elliptic (ginf[geometry].quotientstyle & qELLIP)
|
||||
#define quotient (ginf[geometry].quotientstyle & (qZEBRA | qFIELD))
|
||||
#define torus (ginf[geometry].quotientstyle & qTORUS)
|
||||
#define doall (ginf[geometry].quotientstyle)
|
||||
#define smallbounded (sphere || (quotient & qZEBRA) || torus)
|
||||
#define bounded (sphere || quotient || torus)
|
||||
|
||||
#define a4 (S3 == 4)
|
||||
#define a45 (S3 == 4 && S7 == 5)
|
||||
#define a46 (S3 == 4 && S7 == 6)
|
||||
|
Loading…
Reference in New Issue
Block a user