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


C# GenericReader.ReadShort方法代码示例

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


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

示例1: Deserialize

		public override void Deserialize( GenericReader gr )
		{
			base.Deserialize( gr );
			int version = gr.ReadInt();
			if ( version > 6 )
			{
				int nreput = gr.ReadInt();
				for(int t = 0;t < nreput;t++ )
				{
					int krep = gr.ReadInt();
					int vrep = gr.ReadInt();
					reputationAdjustments[ krep ] = vrep;
				}
			}
			if ( version > 5 )
			{
				int nact = gr.ReadInt();
				for(int t = 0;t < nact;t++ )
					actionBar.Add( new Action( gr ) );
			}
			if ( version > 4 )
			{
				int nf = gr.ReadInt();
				for(int t = 0;t < nf;t++ )
				{
					UInt64 gu = (UInt64)gr.ReadInt64();
					friends.Add( gu );
					string user = gr.ReadString();
					friends.Add( user );
				}
			}
			if ( version > 2 )
			{
				BindingPointX = gr.ReadFloat();
				BindingPointY = gr.ReadFloat();
				BindingPointZ = gr.ReadFloat();
				BindingPointMapId = (UInt16)gr.ReadInt();
			}
			if ( version > 1 )
			{
				bool pa = gr.ReadBool();
				if ( pa )
				{
					petActions = new int[ 11 ];
					for(int t = 0;t < 11;t++ )
						petActions[ t ] = gr.ReadInt();
				}
			}
			int sum = gr.ReadInt();
			if ( sum != 0 )
			{
				UInt64 g = gr.ReadInt64();
				if ( version > 7 )
				{
					int sid = gr.ReadInt();
					Summon = new BaseCreature( gr );
					Summon.Id = sid;
				}
			//	Summon = (Mobile)MobileList.TempSummon[ g ];
				Summon.SummonedBy = this;					
				( Summon as BaseCreature ).AIEngine = new SummonedAI( this, Summon as BaseCreature );
			}
			sum = gr.ReadInt();
			if ( sum != 0 )
			{
				Charm = (Mobile)MobileList.TempSummon[ gr.ReadInt64() ];
				Charm.CharmedBy = this;
				( Charm as BaseCreature ).AIEngine = new SummonedAI( this, Charm as BaseCreature );
			}
			CorpseLocationX = gr.ReadFloat();
			CorpseLocationY = gr.ReadFloat();
			CorpseLocationZ = gr.ReadFloat();
			if ( version > 3 )
				CorpseMapId = (ushort)gr.ReadShort();
			corpsGuid = gr.ReadInt64();
			zones = new uint[ 32 ];
			for(int t = 0;t < 32;t++ )
				zones[ t ] = (uint)gr.ReadInt();
			int exi = gr.ReadInt();
			if ( exi == 1 )
			{
				mark = new Position( gr.ReadFloat(), gr.ReadFloat(), gr.ReadFloat(), gr.ReadInt() );
			}
			ammoType = gr.ReadInt();
			race = (Races)gr.ReadByte();
			if ( version == 0 )
				Classe = (Classes)gr.ReadByte();
			gender = gr.ReadByte();
			skin = gr.ReadByte();
			face = gr.ReadByte();
			hairStyle = gr.ReadByte();
			hairColour = gr.ReadByte();
			facialHair = gr.ReadByte();

			copper = (uint)gr.ReadInt();
			int nactq = 20;
			for(int t = 0;t < nactq;t++ )
			{
				int vv = gr.ReadInt();
				if ( vv == 1 )
//.........这里部分代码省略.........
开发者ID:karliky,项目名称:wowwow,代码行数:101,代码来源:Character.cs

示例2: DesignState

		public DesignState( HouseFoundation foundation, GenericReader reader )
		{
			m_Foundation = foundation;

			int version = reader.ReadInt();

			switch( version )
			{
				case 0:
				{
					m_Components = new MultiComponentList( reader );

					int length = reader.ReadInt();

					m_Fixtures = new MultiTileEntry[length];

					for( int i = 0; i < length; ++i )
					{
						m_Fixtures[i].m_ItemID = reader.ReadUShort();
						m_Fixtures[i].m_OffsetX = reader.ReadShort();
						m_Fixtures[i].m_OffsetY = reader.ReadShort();
						m_Fixtures[i].m_OffsetZ = reader.ReadShort();
						m_Fixtures[i].m_Flags = reader.ReadInt();
					}

					m_Revision = reader.ReadInt();

					break;
				}
			}
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:31,代码来源:HouseFoundation.cs

示例3: Deserialize

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

			int version = reader.ReadInt();
			m_StoredColorName = reader.ReadString();
			m_StoredColorNamePrefix = reader.ReadString();
			m_StoredColor = (int) reader.ReadShort();
			m_Prepped = reader.ReadBool();
			m_Uses = (int) reader.ReadShort();

			// Handle tubs which have been lightened / darkened and not marked prepped for vice versa
			if( version == 0 )
			{
				Prepped = true;
				for(int i = 0; i < 8; i++ )
					if( StoredColor == m_SpecialColors[i, 0] )
	        			Prepped = false;
			}
		}
开发者ID:zerodowned,项目名称:angelisland,代码行数:20,代码来源:SpecialDyeTub.cs

示例4: Load

        public void Load(GenericReader sr)
		{
			// Load instancing data

            // version
            short version = sr.ReadShort();

            switch (version)
            {
                case 0:
                    {
                        m_Name = sr.ReadString();
                        m_StartIndex = sr.ReadShort();
                        m_LastIndex = sr.ReadShort();
                        m_CurIndex = sr.ReadShort();
                        m_StartDate = sr.ReadDateTime();
                        m_EndDate = sr.ReadDateTime();
                        m_Serial = (Serial)sr.ReadInt();
                        break;
                    }
            }

            return;
		}
开发者ID:zerodowned,项目名称:angelisland,代码行数:24,代码来源:DODInstance.cs

示例5: Load

        public bool Load(GenericReader sr)
		{
			// Load instancing data

            // version
            short version = sr.ReadShort();

            switch (version)
            {

                case 0:
                {
                    m_Name = sr.ReadString();       // get the name
                    m_Rarity = sr.ReadShort();      // Now grab the rarity level!
                    int numDODs = sr.ReadShort();   // How many DODs does this group link?
			        if( numDODs == 0 )              // are there any to process?
				        return true;

			        // Read them all in
			        for (int ig = 0; ig < numDODs; ig++)
			        {
				        string sDOD = sr.ReadString();
				        // Match the equivalent DOD instances and link
				        for (int ii = 0; ii < RareFactory.DODInst.Count; ii++)
				        {
					        if (RareFactory.DODInst[ii] is DODInstance)
					        {
						        if (((DODInstance)RareFactory.DODInst[ii]).Name == sDOD)
						        {
							        m_DODInst.Add( (DODInstance) RareFactory.DODInst[ii] );
                                    // adam: shouldn't we be breaking here?!!
						        }
					        }
				        }
			        }
                }
                break;
            }

			return true;
		}
开发者ID:zerodowned,项目名称:angelisland,代码行数:41,代码来源:DODGroup.cs

示例6: Deserialize

		public override void Deserialize( GenericReader gr, int ind, bool fake )
		{
			base.Deserialize( gr, ind, true );
			int version = gr.ReadInt();
			id = gr.ReadInt();
			level = (ProfessionLevels)gr.ReadShort();			
		//	castingTime = gr.ReadInt();	
		//	coolDown = gr.ReadInt();	
		}
开发者ID:karliky,项目名称:wowwow,代码行数:9,代码来源:Profession.cs

示例7: Deserialize

 public virtual void Deserialize( GenericReader gr )
 {
     int version = gr.ReadInt();
     guid = gr.ReadInt64();
     X = gr.ReadFloat();
     Y = gr.ReadFloat();
     Z = gr.ReadFloat();
     Orientation = gr.ReadFloat();
     MapId = (UInt16)gr.ReadShort();
     ZoneId = (int)gr.ReadInt();
     /*	int dec = gr.ReadInt();
         if ( dec == 1 )
             decay = DateTime.Now;*/
 }
开发者ID:karliky,项目名称:wowwow,代码行数:14,代码来源:Object.cs

示例8: Deserialize

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

			int version = reader.ReadInt();

			m_TreasureLevel = (TreasureLevel)reader.ReadByte();
			m_MinSpawnTime = reader.ReadShort();
			m_MaxSpawnTime = reader.ReadShort();

			if( !Locked )
				StartResetTimer();
		}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:13,代码来源:BaseTreasureChest.cs

示例9: Deserialize

 public virtual void Deserialize( GenericReader gr, int ind, bool fake )
 {
     int version = gr.ReadInt();
     index = (ushort)ind;
     current = (ushort)gr.ReadShort();
     max = (ushort)gr.ReadShort();
 }
开发者ID:karliky,项目名称:wowwow,代码行数:7,代码来源:Skill.cs

示例10: Deserialize

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

			short version = reader.ReadShort();

			switch( version )
			{
				case 1 :
					goto case 0;

				case 0 :
					m_Identified = reader.ReadBool();

					string sType =reader.ReadString();
					ItemType = ScriptCompiler.FindTypeByName( sType );

					// iProps
					iProps = new int[4];

					iProps[0] = (int) reader.ReadShort();
					iProps[1] = (int) reader.ReadShort();
					iProps[2] = (int) reader.ReadShort();
					iProps[3] = (int) reader.ReadShort();

					if( version < 1 )
						reader.ReadString(); 				// ID label

					// Approx label
					sApproxLabel = reader.ReadString();

					// Skill stuff
					SkillReq = new int[52];

					iMajorSkill = (int) reader.ReadShort();

					if( version < 1 )
					{
						// Add new lines to name property
						if( m_Identified )
							this.Name = string.Format( "an enchanted {0} scroll\n\n", sApproxLabel);

						// Fix any BlackStaffs or Pitchforks
						if( iMajorSkill == (int) SkillName.Blacksmith && ( ItemType == typeof( BlackStaff ) || ItemType == typeof( Pitchfork ) ) )
							iMajorSkill = (int) SkillName.Tinkering;
					}

					SkillReq[(int) SkillName.Magery] = 80;
					SkillReq[ iMajorSkill ] = 90;

					// Determine skill required :
					if( ItemType.IsSubclassOf(typeof(BaseJewel)) ||
						ItemType.IsSubclassOf(typeof(BaseClothing)) )
						SkillReq[(int) SkillName.ItemID] = 80;
					else
						SkillReq[(int) SkillName.ArmsLore] = 80;

					break;
			}
		}
开发者ID:zerodowned,项目名称:angelisland,代码行数:60,代码来源:EnchantedItem.cs

示例11: Deserialize

		public override void Deserialize( GenericReader gr )
		{
			int version = gr.ReadInt();
			//	id = gr.ReadInt();
			UInt64 g = gr.ReadInt64();				
			SpawnerLink = null;//(BaseSpawner)MobileList.TempSpawner[ g ];

			int esu = 0;
			int ech = 0;
			
			esu = gr.ReadInt();
			ech = gr.ReadInt();
			name = gr.ReadString();
			if ( version > 0 )
				classe = (Classes)gr.ReadInt();
			talent = gr.ReadInt();
			Level = gr.ReadInt();
			model = gr.ReadInt();
			exp = (uint)gr.ReadInt();
			guildId = (uint)gr.ReadInt();
			petLevel = (uint)gr.ReadInt();
			petCreatureFamily = (uint)gr.ReadInt();
			petDisplayId = (uint)gr.ReadInt();
			speed  = gr.ReadFloat();
			size = gr.ReadFloat();					
			faction = (Factions)gr.ReadInt();
			str = gr.ReadInt();
			agility = gr.ReadInt();
			stamina = gr.ReadInt();
			iq = gr.ReadInt();
			spirit = gr.ReadInt();
			baseStr = gr.ReadFloat();
			baseAgility = gr.ReadFloat();
			baseStamina = gr.ReadFloat();
			baseIq = gr.ReadFloat();
			baseSpirit = gr.ReadFloat();
			walkSpeed = gr.ReadFloat();
			if ( walkSpeed == 0 )
				walkSpeed = 4.7777f;
			runSpeed = gr.ReadFloat();
			if ( runSpeed == 0 )
				runSpeed = 7f;
			swimSpeed = gr.ReadFloat();
			if ( swimSpeed == 0 )
				swimSpeed = 4.72f;
			swimBackSpeed = gr.ReadFloat();
			if ( swimBackSpeed == 0 )
				swimBackSpeed = 2.5f;
			hitPoints = gr.ReadInt();
			mana = gr.ReadInt();
			energy = gr.ReadInt();
			rage = gr.ReadInt();
			focus = gr.ReadInt();
			baseHitPoints = gr.ReadInt();
			baseMana = gr.ReadInt();
			baseEnergy = gr.ReadInt();
			baseRage = gr.ReadInt();
			baseFocus = gr.ReadInt();

			block = gr.ReadInt();
			armor = gr.ReadInt();
			resistHoly = gr.ReadInt();
			resistFire = gr.ReadInt();
			resistNature = gr.ReadInt();
			resistFrost = gr.ReadInt();
			resistShadow = gr.ReadInt();
			resistArcane = gr.ReadInt();

			int nSkills = gr.ReadInt();
			for(int t = 0;t < nSkills;t++ )
			{
				ushort skill = (ushort)gr.ReadShort();
				allSkills[ skill ] = Skill.Deserialize( gr, t );
			}

			int nSpells = gr.ReadInt();
			for(int t = 0;t < nSpells;t++ )
			{
				ushort spell = (ushort)gr.ReadShort();
				byte place = gr.ReadByte();
				knownAbilities[ (int)spell ] = (int)place;
				/*	if ( TalentDescription.IsTalent( (int)spell ) )
					{
						if ( onInitialiseTalent[ (int)spell ] != null )
						{
							( onInitialiseTalent[ (int)spell ] as TalentHandlers.TalentHandler )( Abilities.abilities[ (int)spell ], this );
						}
					//	this.AddPermanentAura( Abilities.abilities[ (int)spell ], new Aura() );
					//	permanentAura.Add( spell );
					}*/
			}

			int nTalentList = gr.ReadInt();
			for(int t = 0;t < nTalentList;t++ )
			{
				int spell = gr.ReadInt();
				int lev = gr.ReadInt();
				talentList[ spell ] = (int)lev;
			}
			
//.........这里部分代码省略.........
开发者ID:karliky,项目名称:wowwow,代码行数:101,代码来源:Mobile.cs

示例12: Deserialize

		public override void Deserialize(GenericReader reader)
		{
			base.Deserialize(reader);
			int version = reader.ReadInt();
			m_Active = reader.ReadBool();
			m_Casino = (Casino)reader.ReadInt();
			m_CasinoName = reader.ReadString();
			m_TotalPlays = reader.ReadULong();
			m_TotalCollected = reader.ReadULong();
			m_TotalWon = reader.ReadULong();
			m_ErrorCode = reader.ReadInt();
			m_OrigHue = reader.ReadInt();

			m_InUseBy = reader.ReadMobile();
			m_OnCredit = reader.ReadInt();
			m_Escrow = reader.ReadInt();

			m_SecurityCamMobile = reader.ReadMobile();
			m_SecurityChatter = (VerboseType)reader.ReadInt();

			m_Bet = reader.ReadInt();
			m_TestMode = reader.ReadBool();

			m_DealerDelay = reader.ReadBool();
			m_DoubleAfterSplit = reader.ReadBool();
			m_DealerHitsSoft17 = reader.ReadBool();
			m_DealerTakesPush = reader.ReadBool();
			m_Resplits = reader.ReadBool();
			m_SplitAces = (SplitAces)reader.ReadInt();
			m_BJSplitAces21 = reader.ReadBool();
			m_BJSplitAcesPaysEven = reader.ReadBool();
			m_DoubleDown = (DoubleDown)reader.ReadInt();
			m_PlayerCardsFaceUp = reader.ReadBool();
			m_DealerCardsFaceUp = reader.ReadBool();
			m_NumberOfDecks = reader.ReadShort();
			m_ContinuousShuffle = reader.ReadBool();
			m_MinBet = (BetValues)reader.ReadInt();
			m_MaxBet = (BetValues)reader.ReadInt();
			m_BlackJackPays = (BlackJackPays)reader.ReadInt();
			m_CardSounds = reader.ReadBool();
			carddeck = new CardDeck(m_NumberOfDecks,0);
			m_BJInfo.HandInfo = new HandStruct[5];
			for (int h = 0; h < 5; h++)
			{
				m_BJInfo.HandInfo[h].bet = 0;
				m_BJInfo.HandInfo[h].totalcards = 0;
				m_BJInfo.HandInfo[h].card = new short[12];
				for (int c = 0; c < 12; c++)
					m_BJInfo.HandInfo[h].card[c] = -1;
				m_BJInfo.HandInfo[h].bestscore = 0;
				m_BJInfo.HandInfo[h].altscore = 0;
			}
		}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:53,代码来源:CEOBlackJack.cs


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