1
Fork 0
mirror of https://github.com/Steffo99/hella-farm.git synced 2024-11-21 23:54:23 +00:00

Create Random class with static rng utils

This commit is contained in:
Steffo 2024-04-14 00:22:21 +02:00
parent edbbd130dc
commit 165abc794a
Signed by: steffo
GPG key ID: 5ADA3868646C3FC0

12
random.gd Normal file
View file

@ -0,0 +1,12 @@
class_name Random
## Random number generator utilities
## Lazy init [RandomNumberGenerator].
static var rng: RandomNumberGenerator = null:
get:
if rng == null:
rng = RandomNumberGenerator.new()
return rng
set(value):
rng = value