mirror of
https://github.com/zenorogue/hyperrogue.git
synced 2024-12-18 15:00:26 +00:00
hyper.h: some extra comments
This commit is contained in:
parent
c98f58a672
commit
ea74604f34
37
hyper.h
37
hyper.h
@ -554,12 +554,18 @@ enum hstate { hsOrigin, hsA, hsB, hsError, hsA0, hsA1, hsB0, hsB1, hsC };
|
|||||||
struct cell *createMov(struct cell *c, int d);
|
struct cell *createMov(struct cell *c, int d);
|
||||||
struct heptagon *createStep(struct heptagon *c, int d);
|
struct heptagon *createStep(struct heptagon *c, int d);
|
||||||
|
|
||||||
|
// in bitruncated/irregular/Goldberg geometries, heptagons form the
|
||||||
|
// underlying regular tiling (not necessarily heptagonal); in pure
|
||||||
|
// geometries, they correspond 1-1 to tiles; in 'masterless' geometries
|
||||||
|
// heptagons are unused
|
||||||
|
|
||||||
struct heptagon {
|
struct heptagon {
|
||||||
// automaton state
|
// automaton state
|
||||||
hstate s : 6;
|
hstate s : 6;
|
||||||
unsigned int dm4: 2;
|
unsigned int dm4: 2;
|
||||||
// distance from the origin
|
// distance from the origin
|
||||||
short distance;
|
short distance;
|
||||||
|
// note: all the 'val' values may have different meaning in other geometries
|
||||||
// emerald/wineyard generator
|
// emerald/wineyard generator
|
||||||
short emeraldval;
|
short emeraldval;
|
||||||
// fifty generator
|
// fifty generator
|
||||||
@ -568,10 +574,12 @@ struct heptagon {
|
|||||||
short zebraval;
|
short zebraval;
|
||||||
// field id
|
// field id
|
||||||
int fieldval;
|
int fieldval;
|
||||||
// evolution data
|
// data for fractal landscapes
|
||||||
short rval0, rval1;
|
short rval0, rval1;
|
||||||
struct cdata *cdata; // for alts, this contains the pointer to the original
|
// for alternate structures, cdata contains the pointer to the original
|
||||||
// central cell
|
// for the main map, it contains the fractal landscape data
|
||||||
|
struct cdata *cdata;
|
||||||
|
// central cell of this underlying tiling
|
||||||
cell *c7;
|
cell *c7;
|
||||||
// associated generator of alternate structure, for Camelot and horocycles
|
// associated generator of alternate structure, for Camelot and horocycles
|
||||||
heptagon *alt;
|
heptagon *alt;
|
||||||
@ -593,14 +601,15 @@ struct heptagon {
|
|||||||
};
|
};
|
||||||
|
|
||||||
struct cell : gcell {
|
struct cell : gcell {
|
||||||
char type; // 6 for hexagons, 7 for heptagons
|
char type; int degree() { return type; }
|
||||||
int degree() { return type; }
|
|
||||||
|
|
||||||
// wall parameter, used for remaining power of Bonfires and Thumpers
|
// wall parameter, used for remaining power of Bonfires and Thumpers
|
||||||
char wparam;
|
char wparam;
|
||||||
|
|
||||||
|
// used by celllister
|
||||||
int listindex;
|
int listindex;
|
||||||
|
|
||||||
|
// heptagon who owns us; for 'masterless' tilings it contains coordinates instead
|
||||||
heptagon *master;
|
heptagon *master;
|
||||||
|
|
||||||
connection_table<cell> c;
|
connection_table<cell> c;
|
||||||
@ -656,10 +665,14 @@ inline cellwalker operator+ (heptspin hs, cth_t) { return cellwalker(hs.at->c7,
|
|||||||
// kill count for Graveyard/Hive
|
// kill count for Graveyard/Hive
|
||||||
#define R100 (inv::on ? 500 : 100)
|
#define R100 (inv::on ? 500 : 100)
|
||||||
|
|
||||||
string XLAT(string x);
|
string XLAT(string x); // translate the sentence x
|
||||||
string XLATN(string x);
|
string XLATN(string x); // translate the sentence x
|
||||||
string cts(char c);
|
string cts(char c); // character to string
|
||||||
string its(int i);
|
string its(int i); // int to string
|
||||||
|
|
||||||
|
// a random integer from [0..i), generated by the game's main generator
|
||||||
|
// we want the same world to be generated if the seed is the same. For this purpose,
|
||||||
|
// hrand should be used for all the game-related generation, and nowhere else
|
||||||
int hrand(int i);
|
int hrand(int i);
|
||||||
|
|
||||||
// size casted to int, to prevent warnings and actual errors caused by the unsignedness of x.size()
|
// size casted to int, to prevent warnings and actual errors caused by the unsignedness of x.size()
|
||||||
@ -795,12 +808,14 @@ namespace mirror {
|
|||||||
int neighborId(cell *c1, cell *c2);
|
int neighborId(cell *c1, cell *c2);
|
||||||
|
|
||||||
struct movedir {
|
struct movedir {
|
||||||
int d; // 0 to 6, or one of the following -- warning: not used consistently
|
int d;
|
||||||
|
// non-negative numbers denote 'rotate +d steps and act in this direction
|
||||||
|
// negative numbers have the following meanings (warning: not used consistently):
|
||||||
#define MD_WAIT (-1)
|
#define MD_WAIT (-1)
|
||||||
#define MD_DROP (-2)
|
#define MD_DROP (-2)
|
||||||
#define MD_UNDECIDED (-3)
|
#define MD_UNDECIDED (-3)
|
||||||
#define MD_USE_ORB (-4)
|
#define MD_USE_ORB (-4)
|
||||||
int subdir; // for normal movement (0-6): turn left or right
|
int subdir; // for normal movement (0+): turn left or right
|
||||||
cell *tgt; // for MD_USE_ORB: target cell
|
cell *tgt; // for MD_USE_ORB: target cell
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user