mirror of
https://github.com/kuitoi/kuitoi-Server.git
synced 2026-06-18 14:41:21 +00:00
Util.Random*
This commit is contained in:
@@ -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
|
||||||
|
|||||||
Reference in New Issue
Block a user