diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-03-01 15:00:32 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-03-01 15:00:32 +0100 |
commit | bd7637248c6ada567537392d3c69541c632e1c56 (patch) | |
tree | f4160671a920b05fecd7eb45442466b4fa7371ca /core/math/random_number_generator.cpp | |
parent | d8cfc5e1c8f5d72bc21d42945aeab01bea508fa3 (diff) | |
parent | 88df5ea8acd423f2213441d84f2e0f9cd0280552 (diff) | |
download | redot-engine-bd7637248c6ada567537392d3c69541c632e1c56.tar.gz |
Merge pull request #88883 from joaoh82/add-weighted-random-method
Add `RandomNumberGenerator::rand_weighted` method
Diffstat (limited to 'core/math/random_number_generator.cpp')
-rw-r--r-- | core/math/random_number_generator.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/core/math/random_number_generator.cpp b/core/math/random_number_generator.cpp index c3f36b32a5..226d748c52 100644 --- a/core/math/random_number_generator.cpp +++ b/core/math/random_number_generator.cpp @@ -42,6 +42,7 @@ void RandomNumberGenerator::_bind_methods() { ClassDB::bind_method(D_METHOD("randfn", "mean", "deviation"), &RandomNumberGenerator::randfn, DEFVAL(0.0), DEFVAL(1.0)); ClassDB::bind_method(D_METHOD("randf_range", "from", "to"), &RandomNumberGenerator::randf_range); ClassDB::bind_method(D_METHOD("randi_range", "from", "to"), &RandomNumberGenerator::randi_range); + ClassDB::bind_method(D_METHOD("rand_weighted", "weights"), &RandomNumberGenerator::rand_weighted); ClassDB::bind_method(D_METHOD("randomize"), &RandomNumberGenerator::randomize); ADD_PROPERTY(PropertyInfo(Variant::INT, "seed"), "set_seed", "get_seed"); |