mirror of
https://github.com/kuitoi/kuitoi-Server.git
synced 2025-08-17 16:25:36 +00:00
Util.Random*
This commit is contained in:
parent
ac5f5ee894
commit
3d9e08d05d
@ -247,15 +247,17 @@ class Util:
|
|||||||
def JsonDiffApply(self, base, diff):
|
def JsonDiffApply(self, base, diff):
|
||||||
self.log.debug("requesting JsonDiffApply()")
|
self.log.debug("requesting JsonDiffApply()")
|
||||||
|
|
||||||
def Random(self) -> int:
|
def Random(self) -> float:
|
||||||
self.log.debug("requesting Random()")
|
self.log.debug("requesting Random()")
|
||||||
return random.randint(0, 1)
|
return random.random()
|
||||||
|
|
||||||
def RandomIntRange(self, min_v, max_v):
|
def RandomIntRange(self, min_v, max_v) -> int:
|
||||||
self.log.debug("requesting RandomIntRange()")
|
self.log.debug("requesting RandomIntRange()")
|
||||||
|
return random.randint(min_v, max_v)
|
||||||
|
|
||||||
def RandomRange(self, min_v, max_v):
|
def RandomRange(self, min_v, max_v) -> float:
|
||||||
self.log.debug("requesting RandomRange()")
|
self.log.debug("requesting RandomRange()")
|
||||||
|
return random.uniform(min_v, max_v)
|
||||||
|
|
||||||
|
|
||||||
# noinspection PyPep8Naming
|
# noinspection PyPep8Naming
|
||||||
|
Loading…
x
Reference in New Issue
Block a user