Planet resource produciton calculations and planet resources updates implemented and tested
Signed-off-by: Gregory PLANCHAT <g.planchat@gmail.com>
This commit is contained in:
parent
e15d9f81a7
commit
282eb43a31
6 changed files with 207 additions and 22 deletions
|
|
@ -81,4 +81,50 @@ class Math
|
|||
{
|
||||
return self::getSingleton()->render($a);
|
||||
}
|
||||
|
||||
public static function isNegative($a)
|
||||
{
|
||||
return (bool) (self::getSingleton()->comp($a, 0) < 0);
|
||||
}
|
||||
|
||||
public static function isPositive($a)
|
||||
{
|
||||
return (bool) (self::getSingleton()->comp($a, 0) > 0);
|
||||
}
|
||||
|
||||
public static function isNegativeOrZero($a)
|
||||
{
|
||||
return (bool) (self::getSingleton()->comp($a, 0) <= 0);
|
||||
}
|
||||
|
||||
public static function isPositiveOrZero($a)
|
||||
{
|
||||
return (bool) (self::getSingleton()->comp($a, 0) >= 0);
|
||||
}
|
||||
|
||||
public static function isZero($a)
|
||||
{
|
||||
return (bool) (self::getSingleton()->comp($a, 0) == 0);
|
||||
}
|
||||
|
||||
public static function isNotZero($a)
|
||||
{
|
||||
return (bool) (self::getSingleton()->comp($a, 0) != 0);
|
||||
}
|
||||
|
||||
public static function min($a, $b)
|
||||
{
|
||||
if (self::getSingleton()->comp($a, $b) > 0) {
|
||||
return $b;
|
||||
}
|
||||
return $a;
|
||||
}
|
||||
|
||||
public static function max($a, $b)
|
||||
{
|
||||
if (self::getSingleton()->comp($a, $b) < 0) {
|
||||
return $b;
|
||||
}
|
||||
return $a;
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue