1#ifndef NANOMMO_TERRAIN_LANDS_H_
2#define NANOMMO_TERRAIN_LANDS_H_
31constexpr std::array<Land, 3>
kLands = {{
33 {.name =
"Ashlands", .seed = 1000, .wading = 0.0f},
34 {.name =
"Crypt", .seed = 2000, .wading = 0.0f, .dungeon =
true},
45constexpr std::array<Gate, 4>
kGates = {{
47 {.land = 0, .place = {0.0f, -10.0f}, .to = 1},
48 {.land = 1, .place = {0.0f, -10.0f}, .to = 0},
50 {.land = 0, .place = {12.0f, 0.0f}, .to = 2},
51 {.land = 2, .place = {0.0f, -10.0f}, .to = 0},
60 twin = twin || (other.land == gate.to && other.to == gate.land);
66 for (
int land = 0; land < static_cast<int>(
kLands.size()); ++land) {
69 gate = gate || other.land == land;
71 if (
kLands[land].dungeon && !gate) {
78 "each gate needs a twin, and each dungeon a way out");
89bool IsLand(std::string_view name);
91bool InGate(
const Gate& gate,
float x,
float z);
static constexpr float kWading
Players wade into the sea up to their knees.
constexpr std::array< Gate, 4 > kGates
const Gate & WayOut(int dungeon)
The dungeon's way out: its first gate.
const Gate & Twin(const Gate &gate)
The gate in the land this one takes you to, which leads back.
int LandNamed(std::string_view name)
Its place in the list, or the first land's for a name that isn't there.
constexpr float kArrival
Past the edge of a gate, so that players don't arrive inside it.
Place Arrival(const Gate &gate, float yaw)
bool InGate(const Gate &gate, float x, float z)
constexpr std::array< Land, 3 > kLands
constexpr bool GatesLeadBack()
constexpr float kGateRadius
In metres from the middle of a gate.
bool IsLand(std::string_view name)
A ring of stones in a land, which takes players to another.
int land
Where it stands, and the land it takes you to, by their places in kLands.
uint32_t seed
Added to the world's seed, so that each land has an island of its own.
float wading
How deep into its sea players can wade, in metres.
In metres from the middle of a land.