40 lines
675 B
C
40 lines
675 B
C
#ifndef WORLD_H
|
|
#define WORLD_H
|
|
|
|
#include <stdint.h>
|
|
#include <stdbool.h>
|
|
|
|
#define WORLD_WIDTH 256
|
|
#define WORLD_HEIGHT 256
|
|
|
|
typedef enum {
|
|
Q_EMPTY,
|
|
Q_ASTEROID_FIELD,
|
|
Q_STAR_SYSTEM,
|
|
Q_NEBULA,
|
|
Q_BLACK_HOLE,
|
|
Q_WHITE_HOLE,
|
|
Q_PULSAR,
|
|
Q_QUASAR,
|
|
Q_SUPERNOVA,
|
|
Q_ANOMALY,
|
|
Q_SINGULARITY,
|
|
Q_COUNT
|
|
} quadrant_type;
|
|
|
|
typedef struct {
|
|
quadrant_type type;
|
|
bool is_visited;
|
|
bool is_discovered;
|
|
bool is_old;
|
|
} quadrant_t;
|
|
|
|
typedef struct {
|
|
quadrant_t quadrants[WORLD_HEIGHT][WORLD_WIDTH];
|
|
} world_t;
|
|
|
|
void world_generate(world_t *w);
|
|
const quadrant_t * world_get_quadrant(const world_t *w, uint16_t x, uint16_t y);
|
|
|
|
#endif
|