chore: add clang-format and pre-commit configuration

This commit is contained in:
2026-04-28 09:22:55 +08:00
parent dc3be5a4bc
commit 611a795481
62 changed files with 2166 additions and 2134 deletions

View File

@@ -1,30 +1,23 @@
#include <Cubed/tools/cubed_random.hpp>
#include <Cubed/tools/log.hpp>
#include "Cubed/tools/cubed_random.hpp"
#include "Cubed/tools/log.hpp"
namespace Cubed {
Random::Random() {
}
Random::Random() {}
bool Random::random_bool(double probability) {
std::bernoulli_distribution dist(probability);
return dist(m_engine);
}
std::mt19937& Random::engine() {
return m_engine;
}
std::mt19937& Random::engine() { return m_engine; }
unsigned Random::seed() {
return m_seed;
}
unsigned Random::seed() { return m_seed; }
void Random::init(unsigned seed) {
m_seed = seed;
m_engine.seed(seed);
}
}
} // namespace Cubed