Server.Items.Corpse.Deserialize C# (CSharp) Method

Deserialize() public method

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

			int version = reader.ReadInt();

			switch ( version )
			{
				case 12:
				{
					if ( reader.ReadBool() )
						m_RestoreEquip = reader.ReadStrongItemList();

					goto case 11;
				}
				case 11:
				{
					// Version 11, we move all bools to a CorpseFlag
					m_Flags = (CorpseFlag)reader.ReadInt();

					m_TimeOfDeath = reader.ReadDeltaTime();

					int count = reader.ReadInt();

					for( int i = 0; i < count; ++i )
					{
						Item item = reader.ReadItem();

						if( reader.ReadBool() )
							SetRestoreInfo( item, reader.ReadPoint3D() );
						else if( item != null )
							SetRestoreInfo( item, item.Location );
					}

					if( reader.ReadBool() )
						BeginDecay( reader.ReadDeltaTime() - DateTime.Now );

					m_Looters = reader.ReadStrongMobileList();
					m_Killer = reader.ReadMobile();

					m_Aggressors = reader.ReadStrongMobileList();
					m_Owner = reader.ReadMobile();

					m_CorpseName = reader.ReadString();

					m_AccessLevel = (AccessLevel)reader.ReadInt();
					reader.ReadInt(); // guild reserve
					m_Kills = reader.ReadInt();

					m_EquipItems = reader.ReadStrongItemList();
					break;
				}
				case 10:
				{
					m_TimeOfDeath = reader.ReadDeltaTime();

					goto case 9;
				}
				case 9:
				{
					int count = reader.ReadInt();

					for ( int i = 0; i < count; ++i )
					{
						Item item = reader.ReadItem();

						if ( reader.ReadBool() )
							SetRestoreInfo( item, reader.ReadPoint3D() );
						else if ( item != null )
							SetRestoreInfo( item, item.Location );
					}

					goto case 8;
				}
				case 8:
				{
					SetFlag( CorpseFlag.VisitedByTaxidermist, reader.ReadBool() );

					goto case 7;
				}
				case 7:
				{
					if ( reader.ReadBool() )
						BeginDecay( reader.ReadDeltaTime() - DateTime.Now );

					goto case 6;
				}
				case 6:
				{
					m_Looters = reader.ReadStrongMobileList();
					m_Killer = reader.ReadMobile();

					goto case 5;
				}
				case 5:
				{
					SetFlag( CorpseFlag.Carved, reader.ReadBool() );

					goto case 4;
				}
				case 4:
				{
					m_Aggressors = reader.ReadStrongMobileList();

					goto case 3;
				}
				case 3:
				{
					m_Owner = reader.ReadMobile();

					goto case 2;
				}
				case 2:
				{
					SetFlag( CorpseFlag.NoBones, reader.ReadBool() );

					goto case 1;
				}
				case 1:
				{
					m_CorpseName = reader.ReadString();

					goto case 0;
				}
				case 0:
				{
					if ( version < 10 )
						m_TimeOfDeath = DateTime.Now;

					if ( version < 7 )
						BeginDecay( m_DefaultDecayTime );

					if ( version < 6 )
						m_Looters = new List<Mobile>();

					if ( version < 4 )
						m_Aggressors = new List<Mobile>();

					m_AccessLevel = (AccessLevel)reader.ReadInt();
					reader.ReadInt(); // guild reserve
					m_Kills = reader.ReadInt();
					SetFlag( CorpseFlag.Criminal, reader.ReadBool() );

					m_EquipItems = reader.ReadStrongItemList();

					break;
				}
			}
		}