Пример #1
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            if (version >= 13)
            {
                c_ForcePrivate = reader.ReadBool();
                c_ForcePublic = reader.ReadBool();
                c_NoTrade = reader.ReadBool();
            }

            if (version >= 12)
            {
                c_Free = reader.ReadBool();
            }

            if (version >= 11)
            {
                c_Murderers = (Intu) reader.ReadInt();
            }

            if (version >= 10)
            {
                c_LeaveItems = reader.ReadBool();
            }

            if (version >= 9)
            {
                c_RentToOwn = reader.ReadBool();
                c_OriginalRentTime = reader.ReadTimeSpan();
                c_RTOPayments = reader.ReadInt();
            }

            c_PreviewItems = new List<Item>();
            if (version >= 7)
            {
                int previewcount = reader.ReadInt();
                for (int i = 0; i < previewcount; ++i)
                {
                    Item item = reader.ReadItem();
                    c_PreviewItems.Add(item);
                }
            }

            if (version >= 6)
            {
                c_ItemsPrice = reader.ReadInt();
                c_KeepItems = reader.ReadBool();
            }

            c_DecoreItemInfos = new List<DecoreItemInfo>();
            if (version >= 5)
            {
                int decorecount = reader.ReadInt();
                DecoreItemInfo info;
                for (int i = 0; i < decorecount; ++i)
                {
                    info = new DecoreItemInfo();
                    info.Load(reader);
                    c_DecoreItemInfos.Add(info);
                }

                c_Relock = reader.ReadBool();
            }

            if (version >= 4)
            {
                c_RecurRent = reader.ReadBool();
                c_RentByTime = reader.ReadTimeSpan();
                c_RentTime = reader.ReadDateTime();
                c_DemolishTime = reader.ReadDateTime();
                c_YoungOnly = reader.ReadBool();
                c_MinTotalSkill = reader.ReadInt();
                c_MaxTotalSkill = reader.ReadInt();
            }

            if (version >= 3)
            {
                c_MinZ = reader.ReadInt();
                c_MaxZ = reader.ReadInt();
            }

            if (version >= 2)
            {
                c_House = (TownHouse) reader.ReadItem();
            }

            c_Price = reader.ReadInt();
            c_Locks = reader.ReadInt();
            c_Secures = reader.ReadInt();
            c_BanLoc = reader.ReadPoint3D();
            c_SignLoc = reader.ReadPoint3D();
            c_Skill = reader.ReadString();
            c_SkillReq = reader.ReadDouble();

            c_Blocks = new List<Rectangle2D>();
            int count = reader.ReadInt();
            for (int i = 0; i < count; ++i)
            {
                c_Blocks.Add(reader.ReadRect2D());
            }

            if (c_RentTime > DateTime.Now)
            {
                BeginRentTimer(c_RentTime - DateTime.Now);
            }

            Timer.DelayCall(TimeSpan.Zero, StartTimers);

            ClearPreview();

            s_TownHouseSigns.Add(this);
        }
Пример #2
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            if (version >= 12)
            {
                c_Free = reader.ReadBool();
            }

            if (version >= 11)
            {
                c_Murderers = (Intu)reader.ReadInt();
            }

            if (version >= 10)
            {
                c_LeaveItems = reader.ReadBool();
            }

            if (version >= 9)
            {
                c_RentToOwn        = reader.ReadBool();
                c_OriginalRentTime = reader.ReadTimeSpan();
                c_RTOPayments      = reader.ReadInt();
            }

            c_PreviewItems = new ArrayList();
            if (version >= 7)
            {
                c_PreviewItems = reader.ReadItemList();
            }

            if (version >= 6)
            {
                c_ItemsPrice = reader.ReadInt();
                c_KeepItems  = reader.ReadBool();
            }

            c_DecoreItemInfos = new ArrayList();
            if (version >= 5)
            {
                int            decorecount = reader.ReadInt();
                DecoreItemInfo info;
                for (int i = 0; i < decorecount; ++i)
                {
                    info = new DecoreItemInfo();
                    info.Load(reader);
                    c_DecoreItemInfos.Add(info);
                }

                c_Relock = reader.ReadBool();
            }

            if (version >= 4)
            {
                c_RecurRent     = reader.ReadBool();
                c_RentByTime    = reader.ReadTimeSpan();
                c_RentTime      = reader.ReadDateTime();
                c_DemolishTime  = reader.ReadDateTime();
                c_YoungOnly     = reader.ReadBool();
                c_MinTotalSkill = reader.ReadInt();
                c_MaxTotalSkill = reader.ReadInt();
            }

            if (version >= 3)
            {
                c_MinZ = reader.ReadInt();
                c_MaxZ = reader.ReadInt();
            }

            if (version >= 2)
            {
                c_House = (TownHouse)reader.ReadItem();
            }

            c_Price    = reader.ReadInt();
            c_Locks    = reader.ReadInt();
            c_Secures  = reader.ReadInt();
            c_BanLoc   = reader.ReadPoint3D();
            c_SignLoc  = reader.ReadPoint3D();
            c_Skill    = reader.ReadString();
            c_SkillReq = reader.ReadDouble();

            c_Blocks = new ArrayList();
            int count = reader.ReadInt();

            for (int i = 0; i < count; ++i)
            {
                c_Blocks.Add(reader.ReadRect2D());
            }

            if (c_RentTime > DateTime.Now)
            {
                BeginRentTimer(c_RentTime - DateTime.Now);
            }

            Timer.DelayCall(TimeSpan.Zero, new TimerCallback(StartTimers));

            ClearPreview();

            s_TownHouseSigns.Add(this);
        }
Пример #3
0
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();

            if( version >= 15 )
                m_Flip = reader.ReadBool();

            if( version >= 14 )
            {
                m_Nation = (Nation)reader.ReadInt();
                m_Treasury = (Container)reader.ReadItem();
            }

            if (version >= 13)
            {
                c_ForcePrivate = reader.ReadBool();
                c_ForcePublic = reader.ReadBool();
                c_NoTrade = reader.ReadBool();
            }

            if (version >= 12)
                c_Free = reader.ReadBool();

            if ( version >= 11 )
                c_Murderers = (Intu)reader.ReadInt();

            if ( version >= 10 )
                c_LeaveItems = reader.ReadBool();

            if ( version >= 9 )
            {
                c_RentToOwn = reader.ReadBool();
                c_OriginalRentTime = reader.ReadTimeSpan();
                c_RTOPayments = reader.ReadInt();
            }

            c_PreviewItems = new ArrayList();
            if ( version >= 7 )
                c_PreviewItems = reader.ReadItemList();

            if ( version >= 6 )
            {
                c_ItemsPrice = reader.ReadInt();
                c_KeepItems = reader.ReadBool();
            }

            c_DecoreItemInfos = new ArrayList();
            if ( version >= 5 )
            {
                int decorecount = reader.ReadInt();
                DecoreItemInfo info;
                for( int i = 0; i < decorecount; ++i )
                {
                    info = new DecoreItemInfo();
                    info.Load( reader );
                    c_DecoreItemInfos.Add( info );
                }

                c_Relock = reader.ReadBool();
            }

            if ( version >= 4 )
            {
                c_RecurRent = reader.ReadBool();
                c_RentByTime = reader.ReadTimeSpan();
                c_RentTime = reader.ReadDateTime();
                c_DemolishTime = reader.ReadDateTime();
                c_YoungOnly = reader.ReadBool();
                c_MinTotalSkill = reader.ReadInt();
                c_MaxTotalSkill = reader.ReadInt();
            }

            if ( version >= 3 )
            {
                c_MinZ = reader.ReadInt();
                c_MaxZ = reader.ReadInt();
            }

            if ( version >= 2 )
                c_House = (TownHouse)reader.ReadItem();

            c_Price = reader.ReadInt();
            c_Locks = reader.ReadInt();
            c_Secures = reader.ReadInt();
            c_BanLoc = reader.ReadPoint3D();
            c_SignLoc = reader.ReadPoint3D();
            c_Skill = reader.ReadString();
            c_SkillReq = reader.ReadDouble();

            c_Blocks = new ArrayList();
            int count = reader.ReadInt();
            for ( int i = 0; i < count; ++i )
                c_Blocks.Add( reader.ReadRect2D() );

            Timer.DelayCall(TimeSpan.Zero, new TimerCallback(StartTimers));

            ClearPreview();

            s_TownHouseSigns.Add( this );
        }