import enum gamedeviceActionPropertyFlags
{
	None,
	IsUsedByQuest,
}

import class DeviceActionProperty extends IScriptable
{
	import var name : CName;
	import var typeName : CName;
	import var flags : gamedeviceActionPropertyFlags;
	import var first : Variant;
	import var second : Variant;
	import var third : Variant;
}

class DeviceActionPropertyFunctions
{

	public static function SetUpProperty_Bool( propertyName : CName, value : Bool, nameOnTrue : CName, nameOnFalse : CName ) : DeviceActionProperty
	{
		var prop : DeviceActionProperty;
		prop = new DeviceActionProperty;
		prop.name = propertyName;
		prop.typeName = 'Bool';
		prop.first = value;
		prop.second = nameOnTrue;
		prop.third = nameOnFalse;
		prop.flags = gamedeviceActionPropertyFlags.None;
		return prop;
	}

	public static function GetProperty_Bool( prop : DeviceActionProperty, out value : Bool, out nameOnFalse : CName, out nameOnTrue : CName ) : Bool
	{
		if( prop.typeName != 'Bool' )
		{
			return false;
		}
		value = ( ( Bool )prop.first );
		nameOnTrue = ( ( CName )prop.second );
		nameOnFalse = ( ( CName )prop.third );
		return true;
	}

	public static function GetProperty_Bool( prop : DeviceActionProperty, out value : Bool ) : Bool
	{
		if( prop.typeName != 'Bool' )
		{
			return false;
		}
		value = ( ( Bool )prop.first );
		return true;
	}

	public static function SetUpProperty_Float( propertyName : CName, value : Float ) : DeviceActionProperty
	{
		var prop : DeviceActionProperty;
		prop = new DeviceActionProperty;
		prop.name = propertyName;
		prop.typeName = 'Float';
		prop.first = value;
		prop.flags = gamedeviceActionPropertyFlags.IsUsedByQuest;
		return prop;
	}

	public static function GetProperty_Float( prop : DeviceActionProperty, out value : Float ) : Bool
	{
		if( prop.typeName != 'Float' )
		{
			return false;
		}
		value = ( ( Float )prop.first );
		return true;
	}

	public static function SetUpProperty_Int( propertyName : CName, value : Int32 ) : DeviceActionProperty
	{
		var prop : DeviceActionProperty;
		prop = new DeviceActionProperty;
		prop.name = propertyName;
		prop.typeName = 'Int';
		prop.first = value;
		prop.flags = gamedeviceActionPropertyFlags.IsUsedByQuest;
		return prop;
	}

	public static function GetProperty_Int( prop : DeviceActionProperty, out value : Int32 ) : Bool
	{
		if( prop.typeName != 'Int' )
		{
			return false;
		}
		value = ( ( Int32 )prop.first );
		return true;
	}

	public static function SetUpProperty_IntRanged( propertyName : CName, value : Int32, rangeMin : Int32, rangeMax : Int32 ) : DeviceActionProperty
	{
		var prop : DeviceActionProperty;
		prop = new DeviceActionProperty;
		prop.name = propertyName;
		prop.typeName = 'IntRanged';
		prop.first = value;
		prop.second = rangeMin;
		prop.third = rangeMax;
		prop.flags = gamedeviceActionPropertyFlags.IsUsedByQuest;
		return prop;
	}

	public static function GetProperty_IntRanged( prop : DeviceActionProperty, out value : Int32, out rangeMin : Int32, out rangeMax : Int32 ) : Bool
	{
		if( prop.typeName != 'IntRanged' )
		{
			return false;
		}
		value = ( ( Int32 )prop.first );
		rangeMin = ( ( Int32 )prop.second );
		rangeMax = ( ( Int32 )prop.third );
		return true;
	}

	public static function SetUpProperty_Name( propertyName : CName, value : CName ) : DeviceActionProperty
	{
		var prop : DeviceActionProperty;
		prop = new DeviceActionProperty;
		prop.name = propertyName;
		prop.typeName = 'Name';
		prop.first = value;
		prop.flags = gamedeviceActionPropertyFlags.IsUsedByQuest;
		return prop;
	}

	public static function GetProperty_Name( prop : DeviceActionProperty, out value : CName ) : Bool
	{
		if( prop.typeName != 'Name' )
		{
			return false;
		}
		value = ( ( CName )prop.first );
		return true;
	}

	public static function SetUpProperty_RadioStatus( propertyName : CName, deviceStatus : Int32, const stationName : ref< String > ) : DeviceActionProperty
	{
		var prop : DeviceActionProperty;
		prop = new DeviceActionProperty;
		prop.name = propertyName;
		prop.typeName = 'RadioStatus';
		prop.first = deviceStatus;
		prop.second = stationName;
		prop.flags = gamedeviceActionPropertyFlags.None;
		return prop;
	}

	public static function GetProperty_RadioStatus( prop : DeviceActionProperty, out deviceStatus : Int32, stationName : ref< String > ) : Bool
	{
		if( prop.typeName != 'RadioStatus' )
		{
			return false;
		}
		deviceStatus = ( ( Int32 )prop.first );
		stationName = ( ( String )prop.second );
		return true;
	}

	public static function SetUpProperty_TvStatus( propertyName : CName, deviceStatus : Int32, const stationName : ref< String > ) : DeviceActionProperty
	{
		var prop : DeviceActionProperty;
		prop = new DeviceActionProperty;
		prop.name = propertyName;
		prop.typeName = 'TvStatus';
		prop.first = deviceStatus;
		prop.second = stationName;
		prop.flags = gamedeviceActionPropertyFlags.None;
		return prop;
	}

	public static function GetProperty_TvStatus( prop : DeviceActionProperty, out deviceStatus : Int32, stationName : ref< String > ) : Bool
	{
		if( prop.typeName != 'TvStatus' )
		{
			return false;
		}
		deviceStatus = ( ( Int32 )prop.first );
		stationName = ( ( String )prop.second );
		return true;
	}

	public static function SetUpProperty_MediaStatus( propertyName : CName, deviceStatus : Int32, const stationName : ref< String > ) : DeviceActionProperty
	{
		var prop : DeviceActionProperty;
		prop = new DeviceActionProperty;
		prop.name = propertyName;
		prop.typeName = 'MediaStatus';
		prop.first = deviceStatus;
		prop.second = stationName;
		prop.flags = gamedeviceActionPropertyFlags.None;
		return prop;
	}

	public static function GetProperty_MediaStatus( prop : DeviceActionProperty, out deviceStatus : Int32, stationName : ref< String > ) : Bool
	{
		if( prop.typeName != 'MediaStatus' )
		{
			return false;
		}
		deviceStatus = ( ( Int32 )prop.first );
		stationName = ( ( String )prop.second );
		return true;
	}

	public static function SetUpProperty_ElevatorInt( propertyName : CName, value : Int32, displayValue : Int32 ) : DeviceActionProperty
	{
		var prop : DeviceActionProperty;
		prop = new DeviceActionProperty;
		prop.name = propertyName;
		prop.typeName = 'ElevatorInt';
		prop.first = value;
		prop.second = displayValue;
		prop.flags = gamedeviceActionPropertyFlags.None;
		return prop;
	}

	public static function SetUpProperty_NodeRef( propertyName : CName, value : NodeRef ) : DeviceActionProperty
	{
		var prop : DeviceActionProperty;
		prop = new DeviceActionProperty;
		prop.name = propertyName;
		prop.typeName = 'NodeRef';
		prop.first = value;
		prop.flags = gamedeviceActionPropertyFlags.IsUsedByQuest;
		return prop;
	}

	public static function GetProperty_NodeRef( prop : DeviceActionProperty, out value : NodeRef ) : Bool
	{
		if( prop.typeName != 'NodeRef' )
		{
			return false;
		}
		value = ( ( NodeRef )prop.first );
		return true;
	}

	public static function SetUpProperty_EntityReference( propertyName : CName, value : EntityReference ) : DeviceActionProperty
	{
		var prop : DeviceActionProperty;
		prop = new DeviceActionProperty;
		prop.name = propertyName;
		prop.typeName = 'EntityReference';
		prop.first = value;
		prop.flags = gamedeviceActionPropertyFlags.IsUsedByQuest;
		return prop;
	}

	public static function GetProperty_EntityReference( prop : DeviceActionProperty, out value : EntityReference ) : Bool
	{
		if( prop.typeName != 'EntityReference' )
		{
			return false;
		}
		value = ( ( EntityReference )prop.first );
		return true;
	}

}

