/**
 *	Utils library
 */
#Const	Version			"2017-02-01"
#Const	ScriptName	"Libs/Nadeo/Utils.Script.txt"

// ---------------------------------- //
// Functions
// ---------------------------------- //
// ---------------------------------- //
// Public
// ---------------------------------- //
// ---------------------------------- //
/**	Return the version number of the script
 *
 *	@return														The version number of the script
 */
Text GetScriptVersion() {
	return Version;
}

// ---------------------------------- //
/**	Return the name of the script
 *
 *	@return														The name of the script
 */
Text GetScriptName() {
	return ScriptName;
}

// ---------------------------------- //
/** Convert a Text to a Boolean
 *
 *	@param	_Text											The Text to convert
 *
 *	@return														The converted Boolean
 */
Boolean ToBoolean(Text _Text) {
	return (_Text != "" && _Text != "0" && _Text != "False" && _Text != "false");
}

// ---------------------------------- //
/** Play a sound
 *
 *	@param	_Name		The name of the sound to play
 *	@param	_Variant	The variant to use
 */
Void PlaySound(CUIConfig::EUISound _Name, Integer _Variant) {
	UIManager.UIAll.SendNotice(
		"", 
		CUIConfig::ENoticeLevel::PlayerInfo, Null, 
		CUIConfig::EAvatarVariant::Default, 
		_Name, _Variant
	);
}

// ---------------------------------- //
/** Convert Integers from 1 to 9 into letters from A to I
 *	Other values are converted to A
 *
 *	@param	_N		The Integer to convert
 *
 *	@return			The letter
 */
Text GetLetterFromNumber(Integer _N) {
	switch(_N) {
		case 1 : return "A";
		case 2 : return "B";
		case 3 : return "C";
		case 4 : return "D";
		case 5 : return "E";
		case 6 : return "F";
		case 7 : return "G";
		case 8 : return "H";
		case 9 : return "I";
	}
	return "A";
}