#include "NameGenerator.h" #include #include #include NameGenerator::NameGenerator(QObject* parent) : QObject(parent) {} QString NameGenerator::memorable() { static constexpr std::array adjectives = { "biolume", "molecular", "sinter", "rawsteel", "castiron", "oreseam", "voidsurface", "darkmatter", "hibernation", "singularity", "titanium", "polished", "sensor", "scrapmetal", "acidspray"}; static constexpr std::array nouns = { "forge", "reactor", "conduit", "node", "lattice", "core", "vessel", "shard", "prism", "resonator", "catalyst", "array", "engine", "membrane", "cortex", "nexus", "filament", "anvil", "relay", "beacon"}; QRandomGenerator* rng = QRandomGenerator::global(); const int adjectiveIndex = static_cast(rng->bounded(static_cast(adjectives.size()))); const int nounIndex = static_cast(rng->bounded(static_cast(nouns.size()))); const char* adjective = *std::next(adjectives.begin(), adjectiveIndex); const char* noun = *std::next(nouns.begin(), nounIndex); return QStringLiteral("%1-%2") .arg(QString::fromUtf8(adjective)) .arg(QString::fromUtf8(noun)); }