ModernUO/Scripts/Engines/Reports/Objects/Charts/ChartItem.cs
2018-09-14 08:46:14 -07:00

48 lines
1 KiB
C#

namespace Server.Engines.Reports
{
public class ChartItem : PersistableObject
{
#region Type Identification
public static readonly PersistableType ThisTypeID = new PersistableType( "ci", new ConstructCallback( Construct ) );
private static PersistableObject Construct()
{
return new ChartItem();
}
public override PersistableType TypeID => ThisTypeID;
#endregion
private string m_Name;
private int m_Value;
public string Name{ get => m_Name;
set => m_Name = value;
}
public int Value{ get => m_Value;
set => m_Value = value;
}
private ChartItem()
{
}
public ChartItem( string name, int value )
{
m_Name = name;
m_Value = value;
}
public override void SerializeAttributes( PersistanceWriter op )
{
op.SetString( "n", m_Name );
op.SetInt32( "v", m_Value );
}
public override void DeserializeAttributes( PersistanceReader ip )
{
m_Name = Utility.Intern( ip.GetString( "n" ) );
m_Value = ip.GetInt32( "v" );
}
}
}