當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。