コード例 #1
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadEncodedInt();

            int durationID = reader.ReadEncodedInt();

            if (durationID < VendorRentalDuration.Instances.Length)
            {
                m_RentalDuration = VendorRentalDuration.Instances[durationID];
            }
            else
            {
                m_RentalDuration = VendorRentalDuration.Instances[0];
            }

            m_RentalPrice   = reader.ReadInt();
            m_LandlordRenew = reader.ReadBool();
            m_RenterRenew   = reader.ReadBool();
            m_RenewalPrice  = reader.ReadInt();

            m_RentalGold = reader.ReadInt();

            m_RentalExpireTime = reader.ReadDeltaTime();

            TimeSpan delay = m_RentalExpireTime - DateTime.UtcNow;

            m_RentalExpireTimer = new RentalExpireTimer(this, delay > TimeSpan.Zero ? delay : TimeSpan.Zero);
            m_RentalExpireTimer.Start();
        }
コード例 #2
0
        public RentedVendor(Mobile owner, BaseHouse house, VendorRentalDuration duration, int rentalPrice, bool landlordRenew, int rentalGold) : base(owner, house)
        {
            m_RentalDuration = duration;
            m_RentalPrice    = m_RenewalPrice = rentalPrice;
            m_LandlordRenew  = landlordRenew;
            m_RenterRenew    = false;

            m_RentalGold = rentalGold;

            m_RentalExpireTime  = DateTime.UtcNow + duration.Duration;
            m_RentalExpireTimer = new RentalExpireTimer(this, duration.Duration);
            m_RentalExpireTimer.Start();
        }