Commit graph

14 commits

Author SHA1 Message Date
Andrii Doroshenko (Xrayez)
b5107715f1 Add ability to restore RandomNumberGenerator state
- added `state` as a property to restore internal state of RNG;
- `get_seed()` returns last seed used to initialize the state rather than the current state.

Co-authored-by: MidZik <matt.idzik1@gmail.com>
2020-12-07 13:50:46 +02:00
reduz
127458ed17 Reorganized core/ directory, it was too fatty already
-Removed FuncRef, since Callable makes it obsolete
-Removed int_types.h as its obsolete in c++11+
-Changed color names code
2020-11-07 20:17:12 -03:00
Yuri Roubinsky
38fb26794b Exposed randi_range to global funcs + renamed rand_range to randf_range 2020-11-06 17:06:26 +03:00
Yuri Roubinsky
31faa1f226 Fix biased output of randi_range 2020-10-29 15:41:00 +03:00
Andrii Doroshenko (Xrayez)
1923f0d302 Make randbase member protected in RandomNumberGenerator
Allows to extend `RandomNumberGenerator` via C++ modules.
2020-10-27 01:52:15 +02:00
Rémi Verschelde
0ee0fa42e6 Style: Enforce braces around if blocks and loops
Using clang-tidy's `readability-braces-around-statements`.
https://clang.llvm.org/extra/clang-tidy/checks/readability-braces-around-statements.html
2020-05-14 21:57:34 +02:00
Rémi Verschelde
1f6f364a56 Port member initialization from constructor to declaration (C++11)
Using `clang-tidy`'s `modernize-use-default-member-init` check and
manual review of the changes, and some extra manual changes that
`clang-tidy` failed to do.

Also went manually through all of `core` to find occurrences that
`clang-tidy` couldn't handle, especially all initializations done
in a constructor without using initializer lists.
2020-05-14 10:01:56 +02:00
Rémi Verschelde
a7f49ac9a1 Update copyright statements to 2020
Happy new year to the wonderful Godot community!

We're starting a new decade with a well-established, non-profit, free
and open source game engine, and tons of further improvements in the
pipeline from hundreds of contributors.

Godot will keep getting better, and we're looking forward to all the
games that the community will keep developing and releasing with it.
2020-01-01 11:16:22 +01:00
qarmin
3c154eb93b Remove unnecessary code and add some error explanations 2019-07-01 12:59:42 +02:00
Tomasz Chabora
d89478975f Validate parameters of randi_range() 2019-06-12 19:46:07 +02:00
Chaosus
5f137925dc Added normally distributed generation function to RNG 2019-03-17 08:09:46 +03:00
Rémi Verschelde
b16c309f82 Update copyright statements to 2019
Happy new year to the wonderful Godot community!
2019-01-01 12:58:10 +01:00
Chaosus
d376be2bf4 Added integer number generation function to RNG class 2018-12-06 14:49:52 +03:00
Chaosus
f8151a9e50 Implement random number generator
Co-authored-by: Zirak <zirakertan@gmail.com>
2018-11-13 10:50:07 +03:00