/**********************************************************
RunUO 2.0 AoV C# script file
Official Age of Valor Script :: www.uovalor.com
Last modified by 
Filepath: scripts\_custom\engines\dawns music box\MusicBoxTrack.cs
Lines of code: 49
***********************************************************/


using System;
using System.Collections;
using Server;
using Server.Gumps;
using Server.ContextMenus;
using Server.Network;
using Server.Mobiles;
using Server.Items;

namespace Server.Items.MusicBox
{
    public class MusicBoxTrack : Item
    {
        private int m_Track;
        public int Track { get { return m_Track; } set { m_Track = value; InvalidateProperties();Modify(); } }
        private MusicName m_Song;
        public MusicName Song { get { return m_Song; } set { m_Song = value; InvalidateProperties();Modify(); } }

        public override int LabelNumber { get { return m_Track; } }

        public MusicBoxTrack(int track)
            : base(0x1053)
        {
            m_Track = track;
            Name = "Music Box Song Track";
            Hue = 93;
            Weight = 1.0;
        }

        public MusicBoxTrack(Serial s)
            : base(s)
        {
        }

        public override void OnDoubleClick(Mobile from)
        {
            from.SendLocalizedMessage(LabelNumber);
        }

        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);
            writer.Write((int)0); // version
            writer.Write((int)m_Track);
            writer.Write((int)m_Song);
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();
            m_Track = reader.ReadInt();
            m_Song = (MusicName)reader.ReadInt();
        }
    }
}