using System.Collections.Generic;
using Server.Multis;

namespace Server.Items
{
    public abstract class RowBoatItem : BaseShipItem, IRefreshItemID
    {
        private int m_BaseItemID;

        protected int BaseItemID { get { return m_BaseItemID; } }
        
        protected RowBoatItem(RowBoat rowBoat, int northItemID)
            : this(rowBoat, northItemID, Point3D.Zero)
        {
        }

        protected RowBoatItem(RowBoat rowBoat, int northItemID, Point3D initOffset)
            : base(rowBoat, northItemID, initOffset)
        {
            m_BaseItemID = northItemID;
        }

        public RowBoatItem(Serial serial)
            : base(serial)
        {
        }

        public virtual void RefreshItemID(int itemIDModifier)
        {
            ItemID = (itemIDModifier + m_BaseItemID);
        }

        #region Serialization
        public override void Serialize(GenericWriter writer)
        {
            base.Serialize(writer);

            writer.Write((int)0);
            writer.Write((int)m_BaseItemID);
        }

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            reader.ReadInt();
            m_BaseItemID = reader.ReadInt();
        }
        #endregion
    }
}
