当前位置: 首页>>代码示例>>C#>>正文


C# GenericReader.ReadEncodedInt方法代码示例

本文整理汇总了C#中GenericReader.ReadEncodedInt方法的典型用法代码示例。如果您正苦于以下问题:C# GenericReader.ReadEncodedInt方法的具体用法?C# GenericReader.ReadEncodedInt怎么用?C# GenericReader.ReadEncodedInt使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GenericReader的用法示例。


在下文中一共展示了GenericReader.ReadEncodedInt方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: BOBSmallEntry

		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;
				}
			}
		}
开发者ID:Godkong,项目名称:RunUO,代码行数:28,代码来源:BOBSmallEntry.cs

示例2: VendorInventory

        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();
            }
        }
开发者ID:FreeReign,项目名称:forkuo,代码行数:26,代码来源:VendorInventory.cs

示例3: Deserialize

		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;
				}
			}
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:25,代码来源:Persistance.cs

示例4: Deserialize

		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 );
			}
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:30,代码来源:DawnsMusicGear.cs

示例5: Preferences

        public Preferences(GenericReader reader)
        {
            int version = reader.ReadEncodedInt();

            switch ( version )
            {
                case 0:
                    {
                        int count = reader.ReadEncodedInt();

                        this.m_Table = new Hashtable(count);
                        this.m_Entries = new ArrayList(count);

                        for (int i = 0; i < count; ++i)
                        {
                            PreferencesEntry entry = new PreferencesEntry(reader, this, version);

                            if (entry.Mobile != null)
                            {
                                this.m_Table[entry.Mobile] = entry;
                                this.m_Entries.Add(entry);
                            }
                        }

                        break;
                    }
            }
        }
开发者ID:FreeReign,项目名称:forkuo,代码行数:28,代码来源:Preferences.cs

示例6: Orders

        public Orders( BaseFactionGuard guard, GenericReader reader )
        {
            m_Guard = guard;

            int version = reader.ReadEncodedInt();

            switch ( version )
            {
                case 1:
                {
                    m_Follow = reader.ReadMobile();
                    goto case 0;
                }
                case 0:
                {
                    int count = reader.ReadEncodedInt();
                    m_Reactions = new ArrayList( count );

                    for ( int i = 0; i < count; ++i )
                        m_Reactions.Add( new Reaction( reader ) );

                    m_Movement = (MovementType)reader.ReadEncodedInt();

                    break;
                }
            }
        }
开发者ID:BackupTheBerlios,项目名称:sunuo-svn,代码行数:27,代码来源:Orders.cs

示例7: ReadType

        public static Type ReadType(Type[] referenceTable, GenericReader reader)
        {
            int encoding = reader.ReadEncodedInt();

            switch ( encoding )
            {
                default:
                case 0x00: // null
                    {
                        return null;
                    }
                case 0x01: // indexed
                    {
                        int index = reader.ReadEncodedInt();

                        if (index >= 0 && index < referenceTable.Length)
                            return referenceTable[index];

                        return null;
                    }
                case 0x02: // by name
                    {
                        string fullName = reader.ReadString();

                        if (fullName == null)
                            return null;

                        return ScriptCompiler.FindTypeByFullName(fullName, false);
                    }
            }
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:31,代码来源:QuestSerializer.cs

示例8: Election

        public Election(GenericReader reader)
        {
            int version = reader.ReadEncodedInt();

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

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

                        this.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)
                                this.m_Candidates.Add(cd);
                        }

                        break;
                    }
            }

            this.StartTimer();
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:31,代码来源:Election.cs

示例9: PlayerState

        public PlayerState(GenericReader reader, Faction faction, List<PlayerState> owner)
        {
            this.m_Faction = faction;
            this.m_Owner = owner;

            int version = reader.ReadEncodedInt();

            switch ( version )
            {
                case 1:
                    {
                        this.m_IsActive = reader.ReadBool();
                        this.m_LastHonorTime = reader.ReadDateTime();
                        goto case 0;
                    }
                case 0:
                    {
                        this.m_Mobile = reader.ReadMobile();

                        this.m_KillPoints = reader.ReadEncodedInt();
                        this.m_MerchantTitle = (MerchantTitle)reader.ReadEncodedInt();

                        this.m_Leaving = reader.ReadDateTime();

                        break;
                    }
            }

            this.Attach();
        }
开发者ID:FreeReign,项目名称:forkuo,代码行数:30,代码来源:PlayerState.cs

示例10: BOBLargeEntry

		public BOBLargeEntry( GenericReader reader )
		{
			int version = reader.ReadEncodedInt();

			switch ( version )
			{
				case 0:
				{
					m_RequireExceptional = reader.ReadBool();

					m_DeedType = (BODType)reader.ReadEncodedInt();

					m_Material = (BulkMaterialType)reader.ReadEncodedInt();
					m_AmountMax = reader.ReadEncodedInt();
					m_Price = reader.ReadEncodedInt();

					m_Entries = new BOBLargeSubEntry[reader.ReadEncodedInt()];

					for ( int i = 0; i < m_Entries.Length; ++i )
						m_Entries[i] = new BOBLargeSubEntry( reader );

					break;
				}
			}
		}
开发者ID:kamronbatman,项目名称:DefianceUO-Pre1.10,代码行数:25,代码来源:BOBLargeEntry.cs

示例11: Deserialize

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

			int version = reader.ReadEncodedInt();

			m_Level = (SecureLevel) reader.ReadEncodedInt();
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:8,代码来源:TapestryOfSosaria.cs

示例12: PowerScrollFilter

        public PowerScrollFilter(GenericReader reader)
        {
            int version = reader.ReadEncodedInt();

            switch (version)
            {
                case 1:
                    m_SkillCat = (SkillCategory)reader.ReadEncodedInt();
                    m_SkillValue = reader.ReadEncodedInt();
                    break;
            }
        }
开发者ID:ITLongwell,项目名称:aedilis2server,代码行数:12,代码来源:PowerScrollAccFilter.cs

示例13: PowerScrollBookEntry

        public PowerScrollBookEntry(GenericReader reader)
        {
            int version = reader.ReadEncodedInt();

            switch (version)
            {
                case 0:
                    m_Skill = (SkillName)reader.ReadEncodedInt();
                    m_SkillValue = reader.ReadEncodedInt();
                    m_Price = reader.ReadEncodedInt();
                    break;
            }
        }
开发者ID:ITLongwell,项目名称:aedilis2server,代码行数:13,代码来源:PowerScrollAccBookEntry.cs

示例14: Reaction

		public Reaction( GenericReader reader )
		{
			int version = reader.ReadEncodedInt();

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

					break;
				}
			}
		}
开发者ID:Godkong,项目名称:RunUO,代码行数:15,代码来源:Orders.cs

示例15: TalismanAttribute

        public TalismanAttribute(GenericReader reader)
        {
            int version = reader.ReadInt();

            SaveFlag flags = (SaveFlag)reader.ReadEncodedInt();

            if (GetSaveFlag(flags, SaveFlag.Type))
                this.m_Type = ScriptCompiler.FindTypeByFullName(reader.ReadString(), false);

            if (GetSaveFlag(flags, SaveFlag.Name))
                this.m_Name = TextDefinition.Deserialize(reader);

            if (GetSaveFlag(flags, SaveFlag.Amount))
                this.m_Amount = reader.ReadEncodedInt();
        }
开发者ID:FreeReign,项目名称:forkuo,代码行数:15,代码来源:TalismanAttribute.cs


注:本文中的GenericReader.ReadEncodedInt方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。