TrackManiaControl/application/core/FML/Script/Builder.php
Steffen Schröder b10575d4f2 fml sound feature
2014-01-05 16:04:59 +01:00

37 lines
778 B
PHP

<?php
namespace FML\Script;
/**
* Builder Class offering Methods to build ManiaScript
*
* @author steeffeen
*/
abstract class Builder {
/**
* Build a Label Implementation Block
*
* @param string $labelName
* @param string $implementationCode
* @return string
*/
public static function getLabelImplementationBlock($labelName, $implementationCode) {
$labelText = PHP_EOL . "***{$labelName}***" . PHP_EOL . "***{$implementationCode}***" . PHP_EOL;
return $labelText;
}
/**
* Get the Real String-Representation of the given Value
*
* @param float $value
* @return string
*/
public static function getReal($value) {
$value = (float) $value;
$stringVal = (string) $value;
if (!fmod($value, 1)) $stringVal .= '.';
return $stringVal;
}
}