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


C# GenericReader.ReadTypeCreate方法代码示例

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


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

示例1: Deserialize

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

			var version = reader.GetVersion();

			switch (version)
			{
				case 0:
				{
					reader.ReadBlock(r => Local = reader.ReadTypeCreate<PvPBattleLocalBroadcasts>(r) ?? new PvPBattleLocalBroadcasts());
					reader.ReadBlock(r => World = reader.ReadTypeCreate<PvPBattleWorldBroadcasts>(r) ?? new PvPBattleWorldBroadcasts());
				}
					break;
			}
		}
开发者ID:Ravenwolfe,项目名称:Core,代码行数:16,代码来源:Broadcasts.cs

示例2: Deserialize

		public virtual void Deserialize(GenericReader reader)
		{
			var version = reader.GetVersion();

			switch (version)
			{
				case 2:
				case 1:
				case 0:
				{
					if (version < 2)
					{
						_Info = reader.ReadTypeCreate<ScheduleInfo>(reader) ?? new ScheduleInfo();
					}
					else
					{
						reader.ReadBlock(r => _Info = r.ReadTypeCreate<ScheduleInfo>(r) ?? new ScheduleInfo());
					}

					_Enabled = reader.ReadBool();
					_Name = reader.ReadString();
					_DefaultPriority = reader.ReadFlag<TimerPriority>();

					if (reader.ReadBool())
					{
						_LastGlobalTick = reader.ReadDateTime();
					}

					if (reader.ReadBool())
					{
						_NextGlobalTick = reader.ReadDateTime();
					}

					Delay = reader.ReadTimeSpan();
					Interval = reader.ReadTimeSpan();
				}
					break;
			}

			if (version > 0)
			{
				Running = reader.ReadBool();
			}
		}
开发者ID:Ravenwolfe,项目名称:Core,代码行数:44,代码来源:Schedule.cs

示例3: Deserialize

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

			int version = reader.GetVersion();

			switch (version)
			{
				case 0:
					{
						reader.ReadBlock(
							r => Items = reader.ReadTypeCreate<PvPBattleItemRestrictions>(r) ?? new PvPBattleItemRestrictions(r));
						reader.ReadBlock(
							r => Pets = reader.ReadTypeCreate<PvPBattlePetRestrictions>(r) ?? new PvPBattlePetRestrictions(r));
						reader.ReadBlock(
							r => Skills = reader.ReadTypeCreate<PvPBattleSkillRestrictions>(r) ?? new PvPBattleSkillRestrictions(r));
						reader.ReadBlock(
							r => Spells = reader.ReadTypeCreate<PvPBattleSpellRestrictions>(r) ?? new PvPBattleSpellRestrictions(r));
					}
					break;
			}
		}
开发者ID:greeduomacro,项目名称:RuneUO,代码行数:22,代码来源:Restrictions.cs

示例4: Deserialize

		public virtual void Deserialize(GenericReader reader)
		{
			var version = reader.ReadInt();

			switch (version)
			{
				case 0:
				{
					Months = reader.ReadFlag<ScheduleMonths>();
					Days = reader.ReadFlag<ScheduleDays>();
					Times = reader.ReadTypeCreate<ScheduleTimes>(reader) ?? new ScheduleTimes();
				}
					break;
			}
		}
开发者ID:Ravenwolfe,项目名称:Core,代码行数:15,代码来源:Info.cs

示例5: Deserialize

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

			int version = reader.GetVersion();

			switch (version)
			{
				case 0:
					{
						reader.ReadBlock(
							() => { Advanced = reader.ReadTypeCreate<AutoPvPAdvancedOptions>(reader) ?? new AutoPvPAdvancedOptions(reader); });

						reader.ReadBlock(
							() => { Statistics = reader.ReadTypeCreate<AutoPvPStatistics>(reader) ?? new AutoPvPStatistics(reader); });

						reader.ReadBlock(
							() =>
							{ ExecuteCommands = reader.ReadTypeCreate<AutoPvPExecuteCommands>(reader) ?? new AutoPvPExecuteCommands(reader); });
					}
					break;
			}
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:23,代码来源:SystemOpts.cs

示例6: Deserialize

		public virtual void Deserialize(GenericReader reader)
		{
			int version = reader.GetVersion();

			switch (version)
			{
				case 1:
				case 0:
					{
						_Info = reader.ReadTypeCreate<ScheduleInfo>(reader) ?? new ScheduleInfo(reader);

						_Enabled = reader.ReadBool();
						_Name = reader.ReadString();
						_DefaultPriority = reader.ReadFlag<TimerPriority>();

						if (reader.ReadBool())
						{
							_LastGlobalTick = reader.ReadDateTime();
						}

						if (reader.ReadBool())
						{
							_NextGlobalTick = reader.ReadDateTime();
						}

						Delay = reader.ReadTimeSpan();
						Interval = reader.ReadTimeSpan();
					}
					break;
			}

			if (version < 1)
			{
				return;
			}

			if (reader.ReadBool() && _Enabled)
			{
				Running = true;
			}
		}
开发者ID:jasegiffin,项目名称:JustUO,代码行数:41,代码来源:Schedule.cs

示例7: DeserializeBattle

		private static Tuple<PvPSerial, PvPBattle> DeserializeBattle(GenericReader reader)
		{
			PvPSerial key = null;
			PvPBattle val = null;

			int version = reader.GetVersion();

			switch (version)
			{
				case 0:
					{
						reader.ReadBlock(() => key = reader.ReadTypeCreate<PvPSerial>(reader));
						reader.ReadBlock(() => val = reader.ReadTypeCreate<PvPBattle>(reader));
					}
					break;
			}

			if (key == null)
			{
				if (val != null && val.Serial != null)
				{
					key = val.Serial;
				}
				else
				{
					return null;
				}
			}

			return new Tuple<PvPSerial, PvPBattle>(key, val);
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:31,代码来源:AutoPvP_Init.cs

示例8: Deserialize

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

			int version = reader.GetVersion();

			switch (version)
			{
				case 0:
					{
						reader.ReadBlock(
							() => { Broadcasts = reader.ReadTypeCreate<PvPBattleBroadcasts>(reader) ?? new PvPBattleBroadcasts(reader); });

						reader.ReadBlock(
							() => { Locations = reader.ReadTypeCreate<PvPBattleLocations>(reader) ?? new PvPBattleLocations(reader); });

						reader.ReadBlock(
							() => { Restrictions = reader.ReadTypeCreate<PvPBattleRestrictions>(reader) ?? new PvPBattleRestrictions(reader); });

						reader.ReadBlock(() => { Rewards = reader.ReadTypeCreate<PvPRewards>(reader) ?? new PvPRewards(reader); });

						reader.ReadBlock(() => { Rules = reader.ReadTypeCreate<PvPBattleRules>(reader) ?? new PvPBattleRules(reader); });

						reader.ReadBlock(() => { Sounds = reader.ReadTypeCreate<PvPBattleSounds>(reader) ?? new PvPBattleSounds(reader); });

						reader.ReadBlock(
							() => { SuddenDeath = reader.ReadTypeCreate<PvPBattleSuddenDeath>(reader) ?? new PvPBattleSuddenDeath(reader); });

						reader.ReadBlock(() => { Timing = reader.ReadTypeCreate<PvPBattleTiming>(reader) ?? new PvPBattleTiming(reader); });

						reader.ReadBlock(() => { Weather = reader.ReadTypeCreate<PvPBattleWeather>(reader) ?? new PvPBattleWeather(reader); });
					}
					break;
			}
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:35,代码来源:Options.cs

示例9: DeserializeSeasons

		private static bool DeserializeSeasons(GenericReader reader)
		{
			int version = reader.GetVersion();

			switch (version)
			{
				case 0:
					{
						reader.ReadBlockDictionary(
							() =>
							{
								int key = reader.ReadInt();
								PvPSeason val = reader.ReadTypeCreate<PvPSeason>(reader) ?? new PvPSeason(key);
								return new KeyValuePair<int, PvPSeason>(key, val);
							},
							Seasons);
					}
					break;
			}

			return true;
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:22,代码来源:AutoPvP_Init.cs

示例10: Deserialize

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

			int version = reader.GetVersion();

			switch (version)
			{
				case 1:
					{
						reader.ReadBlock(() => { Misc = reader.ReadTypeCreate<AutoPvPMiscOptions>(reader) ?? new AutoPvPMiscOptions(reader); });
					}
					goto case 0;
				case 0:
					{
						if (version == 0)
						{
							Misc = new AutoPvPMiscOptions();
						}

						reader.ReadBlock(
							() => { Commands = reader.ReadTypeCreate<AutoPvPCommandOptions>(reader) ?? new AutoPvPCommandOptions(reader); });

						reader.ReadBlock(
							() => { Profiles = reader.ReadTypeCreate<AutoPvPProfileOptions>(reader) ?? new AutoPvPProfileOptions(reader); });

						reader.ReadBlock(
							() => { Seasons = reader.ReadTypeCreate<AutoPvPSeasonOptions>(reader) ?? new AutoPvPSeasonOptions(reader); });
					}
					break;
			}
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:32,代码来源:AdvancedOpts.cs

示例11: DeserializeVoteSites

		private static bool DeserializeVoteSites(GenericReader reader)
		{
			int version = reader.GetVersion();

			switch (version)
			{
				case 0:
					{
						reader.ReadBlockDictionary(
							() =>
							{
								var v = reader.ReadTypeCreate<IVoteSite>(reader);

								return new KeyValuePair<int, IVoteSite>(v.UID, v);
							},
							VoteSites);
					}
					break;
			}

			return true;
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:22,代码来源:Voting_Init.cs

示例12: DeserializeHandlers

		private static bool DeserializeHandlers(GenericReader reader)
		{
			var list = reader.ReadBlockArray(() => reader.ReadTypeCreate<BaseTrashHandler>(reader));

			list.ForEach(
				h =>
				{
					if (!Handlers.ContainsKey(h.UID))
					{
						Handlers.Add(h.UID, h);
					}
					else
					{
						Handlers[h.UID] = h;
					}
				});

			InternalHandlerSort();
			return true;
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:20,代码来源:TrashCollection_Init.cs

示例13: Deserialize

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

			int version = reader.GetVersion();

			switch (version)
			{
				case 0:
					{
						reader.ReadBlock(() => { Loser = reader.ReadTypeCreate<PvPReward>(reader) ?? new PvPReward(reader); });

						reader.ReadBlock(() => { Winner = reader.ReadTypeCreate<PvPReward>(reader) ?? new PvPReward(reader); });
					}
					break;
			}
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:17,代码来源:Rewards.cs

示例14: Deserialize

		public virtual void Deserialize(GenericReader reader)
		{
			int version = reader.GetVersion();

			if (version > 5)
			{
				reader.ReadBlock(() =>
				{
					if (version > 6)
					{
						Serial = new PvPSerial(reader);
					}
					else
					{
						Serial = reader.ReadTypeCreate<PvPSerial>(reader) ?? new PvPSerial(reader);
					}
				});
			}

			switch (version)
			{
				case 7:
				case 6:
				case 5:
					Hidden = reader.ReadBool();
					goto case 4;
				case 4:
					FloorItemDelete = reader.ReadBool();
					goto case 3;
				case 3:
				case 2:
					{
						Gate = reader.ReadItem<PvPSpectatorGate>();

						if (Gate != null)
						{
							Gate.Battle = this;
						}
					}
					goto case 1;
				case 1:
					{
						Category = reader.ReadString();
						Ranked = reader.ReadBool();
						InviteWhileRunning = reader.ReadBool();
					}
					goto case 0;
				case 0:
					{
						if (version < 6)
						{
							reader.ReadBlock(() => Serial = reader.ReadTypeCreate<PvPSerial>(reader) ?? new PvPSerial());
						}

						DebugMode = reader.ReadBool();
						State = reader.ReadFlag<PvPBattleState>();
						Name = reader.ReadString();
						Description = reader.ReadString();
						AutoAssign = reader.ReadBool();
						UseTeamColors = reader.ReadBool();
						IgnoreCapacity = reader.ReadBool();
						SubCommandPrefix = reader.ReadChar();
						QueueAllowed = reader.ReadBool();
						SpectateAllowed = reader.ReadBool();
						KillPoints = version < 3 ? (reader.ReadBool() ? 1 : 0) : reader.ReadInt();
						PointsBase = reader.ReadInt();
						PointsRankFactor = reader.ReadDouble();
						IdleKick = reader.ReadBool();
						IdleThreshold = reader.ReadTimeSpan();
						LastState = reader.ReadFlag<PvPBattleState>();
						LastStateChange = reader.ReadDateTime();
						LightLevel = reader.ReadInt();
						LogoutDelay = reader.ReadTimeSpan();

						Doors.AddRange(reader.ReadStrongItemList<BaseDoor>());

						reader.ReadBlock(() => Options = reader.ReadTypeCreate<PvPBattleOptions>(reader) ?? new PvPBattleOptions());

						if (Schedule != null && Schedule.Running)
						{
							Schedule.Stop();
						}

						reader.ReadBlock(
							() => Schedule = reader.ReadTypeCreate<Schedule>(reader) ?? new Schedule("Battle " + Serial.Value, false));

						reader.ReadBlock(
							() => BattleRegion = reader.ReadTypeCreate<PvPBattleRegion>(this, reader) ?? new PvPBattleRegion(this));

						reader.ReadBlock(
							() => SpectateRegion = reader.ReadTypeCreate<PvPSpectateRegion>(this, reader) ?? new PvPSpectateRegion(this));

						reader.ReadBlockList(() => reader.ReadTypeCreate<PvPTeam>(this, reader) ?? new PvPTeam(this), Teams);
					}
					break;
			}
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:97,代码来源:Battle_Serialize.cs

示例15: DeserializeProfiles

		private static bool DeserializeProfiles(GenericReader reader)
		{
			int version = reader.GetVersion();

			switch (version)
			{
				case 0:
					{
						reader.ReadBlockDictionary(
							() =>
							{
								PlayerMobile key = reader.ReadMobile<PlayerMobile>();
								PvPProfile val = reader.ReadTypeCreate<PvPProfile>(reader);
								return new KeyValuePair<PlayerMobile, PvPProfile>(key, val);
							},
							Profiles);
					}
					break;
			}

			return true;
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:22,代码来源:AutoPvP_Init.cs


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