#include "Tile.hpp"
#include "TileType.hpp"
-#include "../const.hpp"
#include "../app/Assets.hpp"
#include "../creature/Creature.hpp"
#include "../graphics/Viewport.hpp"
-#include "../rand/OctaveNoise.hpp"
-#include "../rand/SimplexNoise.hpp"
+#include "../math/const.hpp"
+#include "../math/OctaveNoise.hpp"
+#include "../math/SimplexNoise.hpp"
#include <algorithm>
#include <cmath>
for (creature::Creature *c : Creatures()) {
c->Tick(dt);
}
+ for (auto c = Creatures().begin(); c != Creatures().end();) {
+ if ((*c)->Removable()) {
+ delete *c;
+ c = Creatures().erase(c);
+ } else {
+ ++c;
+ }
+ }
}
void Body::Cache() noexcept {
void GenerateEarthlike(const Set<TileType> &tiles, Planet &p) noexcept {
- rand::SimplexNoise elevation_gen(0);
- rand::SimplexNoise variation_gen(45623752346);
+ math::SimplexNoise elevation_gen(0);
+ math::SimplexNoise variation_gen(45623752346);
const int ice = tiles["ice"].id;
const int ocean = tiles["ocean"].id;
p.TileAt(surface, x, y).type = ice;
continue;
}
- float elevation = rand::OctaveNoise(
+ float elevation = math::OctaveNoise(
elevation_gen,
to_tile / p.Radius(),
3, // octaves
2, // amplitude
2 // growth
);
- float variation = rand::OctaveNoise(
+ float variation = math::OctaveNoise(
variation_gen,
to_tile / p.Radius(),
3, // octaves