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


C# GenericReader.ReadItemG方法代码示例

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


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

示例1: Deserialize

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

			int version = reader.ReadInt();

			switch ( version )
			{
				case 1:
				{
					m_RegionBounds = reader.ReadRect2D();
					m_Traps = reader.ReadStrongItemList<BaseTrap>();

					goto case 0;
				}
				case 0:
				{
					if ( version < 1 )
					{
						m_Traps = new List<BaseTrap>();
						m_RegionBounds = new Rectangle2D( X - 40, Y - 40, 80, 80 );
					}

					m_Creatures = reader.ReadStrongMobileList();

					m_TypeName = reader.ReadString();

					#region genova: support to mono
#if MONO
					m_Door = reader.ReadItemG<BaseDoor>(); ;
					m_Addon = reader.ReadItemG<BaseAddon>(); ;
					m_Sequence = reader.ReadItemG<GauntletSpawner>();
#else
                        m_Door = reader.ReadItem<BaseDoor>(); ;
                        m_Addon = reader.ReadItem<BaseAddon>(); ;
                        m_Sequence = reader.ReadItem<GauntletSpawner>();
#endif
					#endregion

					State = (GauntletSpawnerState)reader.ReadInt();

					break;
				}
			}
		}
开发者ID:brodock,项目名称:genova-project,代码行数:45,代码来源:GauntletSpawner.cs

示例2: Deserialize

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

			int version = reader.ReadInt();

			switch( version )
			{
				case 4:
				{
					m_ConfinedRoaming = reader.ReadBool();

					#region genova: support to mono
#if MONO
					m_Idol = reader.ReadItemG<IdolOfTheChampion>();
#else
                        m_Idol = reader.ReadItem<IdolOfTheChampion>();
#endif
					#endregion

					m_HasBeenAdvanced = reader.ReadBool();

					goto case 3;
				}
				case 3:
				{
					m_SpawnArea = reader.ReadRect2D();

					goto case 2;
				}
				case 2:
				{
					m_RandomizeType = reader.ReadBool();

					goto case 1;
				}
				case 1:
				{
					if( version < 3 )
					{
						int oldRange = reader.ReadInt();

						m_SpawnArea = new Rectangle2D( new Point2D( X - oldRange, Y - oldRange ), new Point2D( X + oldRange, Y + oldRange ) );
					}

					m_Kills = reader.ReadInt();

					goto case 0;
				}
				case 0:
				{
					if( version < 1 )
						m_SpawnArea = new Rectangle2D( new Point2D( X - 24, Y - 24 ), new Point2D( X + 24, Y + 24 ) );	//Default was 24

					bool active = reader.ReadBool();
					m_Type = (ChampionSpawnType)reader.ReadInt();
					m_Creatures = reader.ReadStrongMobileList();
					m_RedSkulls = reader.ReadStrongItemList();
					m_WhiteSkulls = reader.ReadStrongItemList();

					#region genova: support to mono
#if MONO
					m_Platform = reader.ReadItemG<ChampionPlatform>();
					m_Altar = reader.ReadItemG<ChampionAltar>();
#else
                        m_Platform = reader.ReadItem<ChampionPlatform>();
                        m_Altar = reader.ReadItem<ChampionAltar>();
#endif
					#endregion

					m_ExpireDelay = reader.ReadTimeSpan();
					m_ExpireTime = reader.ReadDeltaTime();
					m_Champion = reader.ReadMobile();
					m_RestartDelay = reader.ReadTimeSpan();

					if( reader.ReadBool() )
					{
						m_RestartTime = reader.ReadDeltaTime();
						BeginRestart( m_RestartTime - DateTime.Now );
					}

					if( version < 4 )
					{
						m_Idol = new IdolOfTheChampion( this );
						m_Idol.MoveToWorld( new Point3D( X, Y, Z - 15 ), Map );
					}

					if( m_Platform == null || m_Altar == null || m_Idol == null )
						Delete();
					else if( active )
						Start();

					break;
				}
			}

			Timer.DelayCall( TimeSpan.Zero, new TimerCallback( UpdateRegion ) );
		}
开发者ID:brodock,项目名称:genova-project,代码行数:98,代码来源:ChampionSpawn.cs


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