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


C# GenericWriter.WriteType方法代码示例

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


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

示例1: Serialize

		public override void Serialize(GenericWriter writer)
		{
			base.Serialize(writer);

			int version = writer.SetVersion(0);

			switch (version)
			{
				case 0:
					{
						writer.WriteBlock(
							() => writer.WriteType(
								Loser,
								t =>
								{
									if (t != null)
									{
										Loser.Serialize(writer);
									}
								}));

						writer.WriteBlock(
							() => writer.WriteType(
								Winner,
								t =>
								{
									if (t != null)
									{
										Winner.Serialize(writer);
									}
								}));
					}
					break;
			}
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:35,代码来源:Rewards.cs

示例2: Serialize

		public override void Serialize(GenericWriter writer)
		{
			base.Serialize(writer);

			int version = writer.SetVersion(1);

			switch (version)
			{
				case 1:
					{
						writer.WriteBlock(
							() => writer.WriteType(
								Misc,
								t =>
								{
									if (t != null)
									{
										Misc.Serialize(writer);
									}
								}));
					}
					goto case 0;
				case 0:
					{
						writer.WriteBlock(
							() => writer.WriteType(
								Commands,
								t =>
								{
									if (t != null)
									{
										Commands.Serialize(writer);
									}
								}));

						writer.WriteBlock(
							() => writer.WriteType(
								Profiles,
								t =>
								{
									if (t != null)
									{
										Profiles.Serialize(writer);
									}
								}));

						writer.WriteBlock(
							() => writer.WriteType(
								Seasons,
								t =>
								{
									if (t != null)
									{
										Seasons.Serialize(writer);
									}
								}));
					}
					break;
			}
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:60,代码来源:AdvancedOpts.cs

示例3: Serialize

		public override void Serialize(GenericWriter writer)
		{
			base.Serialize(writer);

			int version = writer.SetVersion(0);

			switch (version)
			{
				case 0:
					{
						writer.WriteBlock(
							() => writer.WriteType(
								Items,
								t =>
								{
									if (t != null)
									{
										Items.Serialize(writer);
									}
								}));

						writer.WriteBlock(
							() => writer.WriteType(
								Pets,
								t =>
								{
									if (t != null)
									{
										Pets.Serialize(writer);
									}
								}));

						writer.WriteBlock(
							() => writer.WriteType(
								Skills,
								t =>
								{
									if (t != null)
									{
										Skills.Serialize(writer);
									}
								}));

						writer.WriteBlock(
							() => writer.WriteType(
								Spells,
								t =>
								{
									if (t != null)
									{
										Spells.Serialize(writer);
									}
								}));
					}
					break;
			}
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:57,代码来源:Restrictions.cs

示例4: Serialize

		private static bool Serialize(GenericWriter writer)
		{
			writer.SetVersion(0);

			writer.WriteBlockDictionary(
				Settings,
				(k, v) =>
				{
					writer.WriteType(k);
					v.Serialize(writer);
				});

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

示例5: Serialize

		public override void Serialize(GenericWriter writer)
		{
			base.Serialize(writer);

			int version = writer.SetVersion(0);

			switch (version)
			{
				case 0:
					{
						writer.WriteBlock(
							() => writer.WriteType(
								Advanced,
								t =>
								{
									if (t != null)
									{
										Advanced.Serialize(writer);
									}
								}));

						writer.WriteBlock(
							() => writer.WriteType(
								Statistics,
								t =>
								{
									if (t != null)
									{
										Statistics.Serialize(writer);
									}
								}));

						writer.WriteBlock(
							() => writer.WriteType(
								ExecuteCommands,
								t =>
								{
									if (t != null)
									{
										ExecuteCommands.Serialize(writer);
									}
								}));
					}
					break;
			}
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:46,代码来源:SystemOpts.cs

示例6: Serialize

		public override void Serialize(GenericWriter writer)
		{
			base.Serialize(writer);

			int version = writer.SetVersion(1);

			switch (version)
			{
				case 1:
					writer.Write(Desc);
					goto case 0;
				case 0:
					{
						writer.WriteType(Type);
						writer.Write(Name);
						writer.Write(CanIgnore);

						writer.WriteBlockDictionary(States, (w, k, v) => v.Serialize(w));
					}
					break;
			}
		}
开发者ID:greeduomacro,项目名称:RuneUO,代码行数:22,代码来源:Settings.cs

示例7: Serialize

		public virtual void Serialize(GenericWriter writer)
		{
			int version = writer.SetVersion(0);

			switch (version)
			{
				case 0:
					{
						writer.Write(Enabled);
						writer.Write(UID);
						writer.WriteFlag(_Priority);
						writer.Write(_BonusTokens);
						writer.Write(_BonusTokensChance);
						writer.WriteList(Accepted, t => writer.WriteType(t));
						writer.WriteList(Ignored, t => writer.WriteType(t));
					}
					break;
			}
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:19,代码来源:BaseTrashHandler.cs

示例8: Serialize

		public override void Serialize(GenericWriter writer)
		{
			base.Serialize(writer);

			int version = writer.SetVersion(0);

			switch (version)
			{
				case 0:
					{
						writer.Write(Name);
						writer.Write(Display);
						writer.Write(DisplaySet);
						writer.WriteType(TypeOf.InternalType);
						writer.Write(IncludeChildTypes);
					}
					break;
			}
		}
开发者ID:greeduomacro,项目名称:RuneUO,代码行数:19,代码来源:Part.cs

示例9: Serialize

		public override void Serialize(GenericWriter writer)
		{
			base.Serialize(writer);

			int version = writer.SetVersion(3);

			switch (version)
			{
				case 3:
					writer.WriteFlag(Level);
					goto case 2;
				case 2:
					writer.Write(RemoveLocked);
					goto case 1;
				case 1:
					{
						writer.Write(EditLocked);
						writer.Write(AddLocked);
						writer.Write(CloneEntryChargeCost);

						writer.WriteDictionary(
							ChargeTypes,
							(k, v) =>
							{
								writer.WriteType(k);
								writer.Write(v);
							});
					}
					goto case 0;
				case 0:
					{
						writer.Write(Charges);
						writer.Write(RecallChargeCost);
						writer.Write(GateChargeCost);
						writer.Write(_Descripton);
						Categories.Serialize(writer);
					}
					break;
			}
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:40,代码来源:RuneCodex.cs

示例10: SerializeBattle

		private static bool SerializeBattle(GenericWriter writer, PvPSerial key, PvPBattle val)
		{
			int version = writer.SetVersion(0);

			switch (version)
			{
				case 0:
					{
						writer.WriteBlock(
							() => writer.WriteType(
								key,
								t =>
								{
									if (t != null)
									{
										key.Serialize(writer);
									}
								}));

						writer.WriteBlock(
							() => writer.WriteType(
								val,
								t =>
								{
									if (t != null)
									{
										val.Serialize(writer);
									}
								}));
					}
					break;
			}

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

示例11: Serialize

		public override void Serialize(GenericWriter writer)
		{
			base.Serialize(writer);

			int version = writer.SetVersion(0);

			switch (version)
			{
				case 0:
					{
						writer.WriteBlock(
							() => writer.WriteType(
								Broadcasts,
								t =>
								{
									if (t != null)
									{
										Broadcasts.Serialize(writer);
									}
								}));

						writer.WriteBlock(
							() => writer.WriteType(
								Locations,
								t =>
								{
									if (t != null)
									{
										Locations.Serialize(writer);
									}
								}));

						writer.WriteBlock(
							() => writer.WriteType(
								Restrictions,
								t =>
								{
									if (t != null)
									{
										Restrictions.Serialize(writer);
									}
								}));

						writer.WriteBlock(
							() => writer.WriteType(
								Rewards,
								t =>
								{
									if (t != null)
									{
										Rewards.Serialize(writer);
									}
								}));

						writer.WriteBlock(
							() => writer.WriteType(
								Rules,
								t =>
								{
									if (t != null)
									{
										Rules.Serialize(writer);
									}
								}));

						writer.WriteBlock(
							() => writer.WriteType(
								Sounds,
								t =>
								{
									if (t != null)
									{
										Sounds.Serialize(writer);
									}
								}));

						writer.WriteBlock(
							() => writer.WriteType(
								SuddenDeath,
								t =>
								{
									if (t != null)
									{
										SuddenDeath.Serialize(writer);
									}
								}));

						writer.WriteBlock(
							() => writer.WriteType(
								Timing,
								t =>
								{
									if (t != null)
									{
										Timing.Serialize(writer);
									}
								}));

						writer.WriteBlock(
							() => writer.WriteType(
//.........这里部分代码省略.........
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:101,代码来源:Options.cs

示例12: Serialize

		public virtual void Serialize(GenericWriter writer)
		{
			var version = writer.SetVersion(2);

			switch (version)
			{
				case 2:
				case 1:
				case 0:
				{
					if (version < 2)
					{
						writer.WriteType(_Info, t => _Info.Serialize(writer));
					}
					else
					{
						writer.WriteBlock(w => w.WriteType(_Info, t => _Info.Serialize(w)));
					}

					writer.Write(_Enabled);
					writer.Write(_Name);
					writer.WriteFlag(_DefaultPriority);

					if (_LastGlobalTick != null)
					{
						writer.Write(true);
						writer.Write(_LastGlobalTick.Value);
					}
					else
					{
						writer.Write(false);
					}

					if (_NextGlobalTick != null)
					{
						writer.Write(true);
						writer.Write(_NextGlobalTick.Value);
					}
					else
					{
						writer.Write(false);
					}

					writer.Write(Delay);
					writer.Write(Interval);
				}
					break;
			}

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

示例13: Serialize

		public virtual void Serialize(GenericWriter writer)
		{
			var version = writer.SetVersion(0);

			switch (version)
			{
				case 0:
				{
					writer.WriteFlag(Months);
					writer.WriteFlag(Days);
					writer.WriteType(Times, t => Times.Serialize(writer));
				}
					break;
			}
		}
开发者ID:Ravenwolfe,项目名称:Core,代码行数:15,代码来源:Info.cs

示例14: SerializeVoteSites

		private static bool SerializeVoteSites(GenericWriter writer)
		{
			int version = writer.SetVersion(0);

			switch (version)
			{
				case 0:
					{
						writer.WriteBlockDictionary(
							VoteSites,
							(k, v) => writer.WriteType(
								v,
								t =>
								{
									if (t != null)
									{
										v.Serialize(writer);
									}
								}));
					}
					break;
			}

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

示例15: Serialize

		public override void Serialize(GenericWriter writer)
		{
			writer.Write(VitaNexCore.Version);

			base.Serialize(writer);

			var version = writer.SetVersion(0);

			switch (version)
			{
				case 0:
					writer.WriteType(_ModuleType);
					break;
			}
		}
开发者ID:Ravenwolfe,项目名称:Core,代码行数:15,代码来源:VitaNex_Modules.cs


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