C# (CSharp) GenericReader Code Examples

C# (CSharp) GenericReader - 30 examples found. These are the top rated real world C# (CSharp) examples of GenericReader extracted from open source projects. You can rate examples to help us improve the quality of examples
Example #1
0
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();
			//ShowUsesRemaining = true;
		}
Example #2
0
		public Election( GenericReader reader )
		{
			int version = reader.ReadEncodedInt();

			switch ( version )
			{
				case 0:
				{
					m_Faction = Faction.ReadReference( reader );

					m_LastStateTime = reader.ReadDateTime();
					m_State = (ElectionState)reader.ReadEncodedInt();

					m_Candidates = new List<Candidate>();

					int count = reader.ReadEncodedInt();

					for ( int i = 0; i < count; ++i )
					{
						Candidate cd = new Candidate( reader );

						if ( cd.Mobile != null )
							m_Candidates.Add( cd );
					}

					break;
				}
			}

			StartTimer();
		}
Example #3
0
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			/*int version = */
			reader.ReadInt();
		}
Example #4
0
		public override void Deserialize( GenericReader reader ) 
		{ 
			base.Deserialize( reader ); 
			int version = reader.ReadInt(); 

			m_Player = (PlayerMobile)reader.ReadMobile(); 
		} 
Example #5
0
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );
			LootType = LootType.Blessed;

			int version = reader.ReadInt();
		}
Example #6
0
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			switch ( version )
			{
                case 2:
			        {
			            m_MaxAmount = reader.ReadInt();
                        goto case 1;
			        }
			    case 1:
				case 0:
				{
					m_Type = (PotionEffect)reader.ReadInt();
					m_Held = reader.ReadInt();

					break;
				}
			}

			if ( version < 1 )
				Timer.DelayCall( TimeSpan.Zero, new TimerCallback( UpdateWeight ) );
		}
Example #7
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch (version)
            {
                case 1:
                    {
                        TimeSpan duration = reader.ReadTimeSpan();

                        m_Timer = new InternalTimer(this, duration);
                        m_Timer.Start();

                        m_End = DateTime.Now + duration;

                        break;
                    }
                case 0:
                    {
                        TimeSpan duration = TimeSpan.FromSeconds(10.0);

                        m_Timer = new InternalTimer(this, duration);
                        m_Timer.Start();

                        m_End = DateTime.Now + duration;

                        break;
                    }
            }
        }
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );
              		int version = reader.ReadInt();

            switch ( version )
            {
                case 1:
                {
                    m_End = reader.ReadDeltaTime();
                    m_EvolutionTimer = new EvolutionTimer( this, m_End - DateTime.Now );
                    m_EvolutionTimer.Start();

                    break;
                }
                case 0:
                {
                    TimeSpan duration = TimeSpan.FromDays( 1.0 );

                    m_EvolutionTimer = new EvolutionTimer( this, duration );
                    m_EvolutionTimer.Start();
                    m_End = DateTime.Now + duration;

                    break;
                }
            }
        }
Example #9
0
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			switch ( version )
			{
				case 2:
				{
					m_ShowUsesRemaining = reader.ReadBool();
					goto case 1;
				}
				case 1:
				{
					m_UsesRemaining = reader.ReadInt();
					goto case 0;
				}
				case 0:
				{
					if ( m_UsesRemaining < 1 )
						m_UsesRemaining = 150;

					break;
				}
			}
		}
		public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();

            switch (version)
            {
                case 1:
                    {
                        reader.ReadItemList();
                        goto case 0;
                    }
                case 0:
                    {
                        reader.ReadBool();
                        reader.ReadItemList();
                        reader.ReadItemList();
                        reader.ReadItemList();
                        reader.ReadItemList();
                        reader.ReadItemList();
                        reader.ReadTimeSpan();
                        reader.ReadInt();
                        break;
                    }
            }
			DeleteAll();
			Delete();
        }
Example #11
0
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );
            int version = reader.ReadInt();

            m_ManaLeeched = reader.ReadInt();
        }
Example #12
0
		public override void Deserialize(GenericReader reader)
		{
			base.Deserialize(reader);

			int version = reader.ReadInt();
			switch (version)
			{
				case 1:
					Range = reader.ReadInt();
					goto case 0;
				case 0:
					// version 0

					m_OriginalID = reader.ReadInt();
					m_MorphID = reader.ReadInt();
					m_Duration = reader.ReadTimeSpan();
					ActivationWord = reader.ReadString();
					TimeSpan remaining = reader.ReadTimeSpan();

					if (remaining > TimeSpan.Zero)
					{
						DoTimer(remaining);
					}
					break;
			}
		}
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			m_Commodity = reader.ReadItem();

			switch ( version )
			{
				case 0:
				{
					if (m_Commodity != null)
					{
						Hue = 0x592;
					}
					break;
				}
			}

			if ( m_Commodity != null && !( m_Commodity is ICommodity ) ) //Apparently, there may be items out there with this.  Funky.
			{
				Timer.DelayCall( TimeSpan.Zero, this.Delete );
			}
		}
Example #14
0
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );
			int version = reader.ReadInt();

			DynamicFurniture.Close( this );
		}
Example #15
0
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadEncodedInt();
			
			switch ( version )
			{
				case 1:
				{
					m_Music = (MusicName) reader.ReadInt();
					break;
				}
			}
			
			if ( version == 0 ) // Music wasn't serialized in version 0, pick a new track of random rarity
			{
				DawnsMusicRarity rarity;
				double rand = Utility.RandomDouble();
				
				if ( rand < 0.025 )
					rarity = DawnsMusicRarity.Rare;
				else if ( rand < 0.225 )
					rarity = DawnsMusicRarity.Uncommon;
				else
					rarity = DawnsMusicRarity.Common;
				
				m_Music = DawnsMusicBox.RandomTrack( rarity );
			}
		}
Example #16
0
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );

            int version = reader.ReadInt();

            switch ( version )
            {
                case 2:
                case 1:
                {
                    break;
                }
                case 0:
                {
                    /*m_EffectID =*/ reader.ReadInt();
                    break;
                }
            }

            if ( version < 2 )
            {
                WeaponAttributes.MageWeapon = 0;
                WeaponAttributes.UseBestSkill = 0;
            }
        }
Example #17
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.GetVersion();

        }
Example #18
0
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );
			Hue = 1259;

			int version = reader.ReadInt();
		}
		public void Deserialize( GenericReader reader, int version )
		{
			switch( version )
			{
				case 2:
				{
					m_Description = reader.ReadString();

					goto case 1;
				}
				case 1:
				{
					m_BlessBond = reader.ReadBool();
					m_BBPrice = reader.ReadInt();

					goto case 0;
				}
				case 0:
				{
					m_Item = reader.ReadString();
					m_Name = reader.ReadString();
					m_Price = reader.ReadInt();
					m_Amount = reader.ReadInt();

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

            m_RemovalTime = reader.ReadDateTime();
            TemporaryItemSystem.Verify(this);
        }
Example #21
0
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			switch ( version )
			{
				case 1:
				{
					m_House = reader.ReadItem() as BaseHouse;
					goto case 0;
				}
				case 0:
				{
					m_Description = reader.ReadString();
					m_Marked = reader.ReadBool();
					m_Target = reader.ReadPoint3D();
					m_TargetMap = reader.ReadMap();

					CalculateHue();

					break;
				}
			}
		}
 public LocationStruct(GenericReader reader)
 {
     int version = reader.ReadInt();
     Map = reader.ReadMap();
     Location = reader.ReadPoint3D();
     Name = reader.ReadString();
 }
Example #23
0
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );
            int version = reader.ReadInt();

            init( this );
        }
Example #24
0
		public override void Deserialize(GenericReader reader)
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			switch ( version )
			{
				case 0:
				{
					PersistedType type;

					while ( (type = (PersistedType)reader.ReadEncodedInt()) != PersistedType.Terminator )
					{
						switch ( type )
						{
							case PersistedType.Faction: new FactionState( reader ); break;
							case PersistedType.Town: new TownState( reader ); break;
						}
					}

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

			int version = reader.ReadInt();
			Layer = Layer.Invalid;
		}
Example #26
0
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();

            this.m_StrengthBonus = reader.ReadInt();
        }
Example #27
0
		public BOBSmallEntry( GenericReader reader )
		{
			int version = reader.ReadEncodedInt();

			switch ( version )
			{
				case 0:
				{
					string type = reader.ReadString();

					if ( type != null )
						m_ItemType = ScriptCompiler.FindTypeByFullName( type );

					m_RequireExceptional = reader.ReadBool();

					m_DeedType = (BODType)reader.ReadEncodedInt();

					m_Material = (BulkMaterialType)reader.ReadEncodedInt();
					m_AmountCur = reader.ReadEncodedInt();
					m_AmountMax = reader.ReadEncodedInt();
					m_Number = reader.ReadEncodedInt();
					m_Graphic = reader.ReadEncodedInt();
					m_Price = reader.ReadEncodedInt();

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

         int version = reader.ReadInt();

         switch ( version )
         {
            case 0:
            {
               Slot1Graphic = reader.ReadInt();
               Slot2Graphic = reader.ReadInt();
               Slot3Graphic = reader.ReadInt();
               Slot1_x = reader.ReadInt();
               Slot1_y = reader.ReadInt();
               Slot2_x = reader.ReadInt();
               Slot2_y = reader.ReadInt();
               Slot3_x = reader.ReadInt();
               Slot3_y = reader.ReadInt();
               Prize1WinTotal = reader.ReadInt();
               Prize2WinTotal = reader.ReadInt();
               Prize3WinTotal = reader.ReadInt();
               Prize4WinTotal = reader.ReadInt();
               Prize5WinTotal = reader.ReadInt();
               Prize6WinTotal = reader.ReadInt();
               Prize7WinTotal = reader.ReadInt();
	       Prize8WinTotal = reader.ReadInt();
               break;
            }
         }
      }
		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			switch ( version )
			{
				case 3:
				case 2:
				{
					m_Level = reader.ReadInt();
					goto case 1;
				}
				case 1:
				{
					m_TargetMap = reader.ReadMap();
					break;
				}
				case 0:
				{
					m_TargetMap = Map.Felucca;
					break;
				}
			}

			if ( version < 2 )
				m_Level = GetRandomLevel();

//			if( version < 3 && m_TargetMap == Map.Tokuno )
//				m_TargetMap = Map.Felucca;
		}
Example #30
0
        public VendorInventory(BaseHouse house, GenericReader reader)
        {
            this.m_House = house;

            int version = reader.ReadEncodedInt();

            this.m_Owner = reader.ReadMobile();
            this.m_VendorName = reader.ReadString();
            this.m_ShopName = reader.ReadString();

            this.m_Items = reader.ReadStrongItemList();
            this.m_Gold = reader.ReadInt();

            this.m_ExpireTime = reader.ReadDeltaTime();

            if (this.m_Items.Count == 0 && this.m_Gold == 0)
            {
                Timer.DelayCall(TimeSpan.Zero, new TimerCallback(Delete));
            }
            else
            {
                TimeSpan delay = this.m_ExpireTime - DateTime.Now;
                this.m_ExpireTimer = new ExpireTimer(this, delay > TimeSpan.Zero ? delay : TimeSpan.Zero);
                this.m_ExpireTimer.Start();
            }
        }