class RipperdocShardController extends inkLogicController
{
	private editable var m_icon : inkImageRef;
	private editable var m_text : inkTextRef;
	private var m_data : RipperdocShardData;
	private var m_pulse : PulseAnimation;
	private var m_RootWidget : weak< inkWidget >;

	public function GetQuality() : gamedataQuality
	{
		return m_data.Quality;
	}

	public function GetCount() : Int32
	{
		return m_data.Count;
	}

	public function SetCount( count : Int32 )
	{
		m_data.Count = count;
		inkTextRef.SetText( m_text, IntToString( m_data.Count ) );
		m_RootWidget.SetVisible( count > 0 );
	}

	public function Highlight( active : Bool )
	{
		( ( active ) ? ( m_pulse.Start() ) : ( m_pulse.Stop() ) );
	}

	public function SetVisible( isVisible : Bool )
	{
		m_RootWidget.SetVisible( isVisible );
	}

	public function Configure( data : RipperdocShardData )
	{
		m_data = data;
		m_RootWidget = GetRootWidget();
		inkImageRef.SetState( m_icon, EnumValueToName( 'gamedataQuality', ( ( Int32 )( data.Quality ) ) ) );
		SetCount( data.Count );
		m_pulse = new PulseAnimation;
		m_pulse.Configure( m_RootWidget, 1.0, 0.1, 0.5 );
	}

}

class RipperdocShardData extends IScriptable
{
	var Count : Int32;
	var Quality : gamedataQuality;
}

