コード例 #1
0
		public void CheckVendors( bool citydelete )
		{
			if ( m_Vendors != null ) //Set Vendors to delete after 2 days
			{
				
				foreach ( CityPlayerVendor vend in m_Vendors )
				{
					if ( vend != null )
					{
						if ( vend is CityRentedVendor )
						{
							if ( vend.Region is CityMarketRegion && !citydelete )
								continue;
							else
							{
								vend.City = null;
								vend.Die = DateTime.Now + TimeSpan.FromDays( 2.0 );
								Timer t = new CityVendorDismiss( vend, vend.Die );
								Mobile owner = vend.Owner;
								owner.SendMessage( "Your vendor will delete in 2 days since your city is gone." );
								t.Start();
							}
						}
						
						else if (  ( vend.Region is PlayerCityRegion || vend.Region is CityMarketRegion ) && !citydelete )
							continue;
						else
						{
							vend.City = null;
							vend.Die = DateTime.Now + TimeSpan.FromDays( 2.0 );
							Mobile owner = vend.Owner;
							Timer t = new CityVendorDismiss( vend, vend.Die );
							owner.SendMessage( "Your vendor will delete in 2 days since your city is gone." );
							t.Start();
						}
						
					}
				}
			}
		}
コード例 #2
0
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();
			
			m_Die = reader.ReadDeltaTime();
			m_stone = (CityManagementStone)reader.ReadItem();
			m_IncomeTax = reader.ReadInt();
			m_TaxRate = reader.ReadInt();
			
			if ( m_stone == null )
			{
				Timer t = new CityVendorDismiss( this, m_Die );
				t.Start();
			}
		}