Parcourir la source

added random().

Nicolas Cannasse il y a 19 ans
Parent
commit
7b3968bf10
2 fichiers modifiés avec 5 ajouts et 0 suppressions
  1. 1 0
      std/Math.hx
  2. 4 0
      std/neko/NekoMath__.hx

+ 1 - 0
std/Math.hx

@@ -44,6 +44,7 @@ extern class Math
 	static function asin(value:Float):Float;
 	static function acos(value:Float):Float;
 	static function pow(value1:Float,value2:Float):Float;
+	static function random() : Float;
 }
 
 

+ 4 - 0
std/neko/NekoMath__.hx

@@ -44,6 +44,10 @@ class NekoMath__
 	static var asin = Lib.load("std","math_asin",1);
 	static var acos = Lib.load("std","math_acos",1);
 	static var pow = Lib.load("std","math_pow",2);
+
+	static var _rnd = Lib.load("std","random_new",0)();
+	static var _random = Lib.load("std","random_float",1);
+	static function random() { return _random(_rnd); }
 }