當前位置: 首頁>>代碼示例>>C#>>正文


C# GenericWriter.WriteBlock方法代碼示例

本文整理匯總了C#中Server.GenericWriter.WriteBlock方法的典型用法代碼示例。如果您正苦於以下問題:C# GenericWriter.WriteBlock方法的具體用法?C# GenericWriter.WriteBlock怎麽用?C# GenericWriter.WriteBlock使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Server.GenericWriter的用法示例。


在下文中一共展示了GenericWriter.WriteBlock方法的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);

			var version = writer.SetVersion(0);

			switch (version)
			{
				case 0:
				{
					writer.WriteBlock(w => w.WriteType(Local, t => Local.Serialize(w)));
					writer.WriteBlock(w => w.WriteType(World, t => World.Serialize(w)));
				}
					break;
			}
		}
開發者ID:Ravenwolfe,項目名稱:Core,代碼行數:16,代碼來源:Broadcasts.cs

示例3: 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

示例4: Serialize

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

			int version = writer.SetVersion(0);

			switch (version)
			{
				case 0:
					{
						writer.WriteBlock(w => w.WriteType(Loser, t => Loser.Serialize(w)));
						writer.WriteBlock(w => w.WriteType(Winner, t => Winner.Serialize(w)));
					}
					break;
			}
		}
開發者ID:greeduomacro,項目名稱:RuneUO,代碼行數:16,代碼來源:Rewards.cs

示例5: Serialize

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

			int version = writer.SetVersion(0);

			switch (version)
			{
				case 0:
					{
						writer.WriteBlock(w => w.WriteType(Advanced, t => Advanced.Serialize(w)));
						writer.WriteBlock(w => w.WriteType(Statistics, t => Statistics.Serialize(w)));
						writer.WriteBlock(w => w.WriteType(ExecuteCommands, t => ExecuteCommands.Serialize(w)));
					}
					break;
			}
		}
開發者ID:greeduomacro,項目名稱:RuneUO,代碼行數:17,代碼來源:SystemOpts.cs

示例6: Serialize

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

			int version = writer.SetVersion(0);

			switch (version)
			{
				case 0:
					{
						writer.WriteBlock(w => w.WriteType(Items, t => Items.Serialize(w)));
						writer.WriteBlock(w => w.WriteType(Pets, t => Pets.Serialize(w)));
						writer.WriteBlock(w => w.WriteType(Skills, t => Skills.Serialize(w)));
						writer.WriteBlock(w => w.WriteType(Spells, t => Spells.Serialize(w)));
					}
					break;
			}
		}
開發者ID:greeduomacro,項目名稱:RuneUO,代碼行數:18,代碼來源:Restrictions.cs

示例7: 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

示例8: Serialize

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

			int version = writer.SetVersion(1);

			switch (version)
			{
				case 1:
					writer.WriteBlock(w => w.WriteType(Misc, t => Misc.Serialize(w)));
					goto case 0;
				case 0:
					{
						writer.WriteBlock(w => w.WriteType(Commands, t => Commands.Serialize(w)));
						writer.WriteBlock(w => w.WriteType(Profiles, t => Profiles.Serialize(w)));
						writer.WriteBlock(w => w.WriteType(Seasons, t => Seasons.Serialize(w)));
					}
					break;
			}
		}
開發者ID:jasegiffin,項目名稱:JustUO,代碼行數:20,代碼來源:AdvancedOpts.cs

示例9: Serialize

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

			int version = writer.SetVersion(1);

			switch (version)
			{
				case 1:
					{
						writer.Write(SkipTicks);
						writer.Write(SkippedTicks);
					}
					goto case 0;
				case 0:
					{
						writer.WriteBlock(
							w =>
							{
								writer.Write(CurrentSeason);
								writer.Write(TopListCount);
								writer.Write(RunnersUpCount);

								writer.WriteType(ScheduleInfo, t => ScheduleInfo.Serialize(w));

								writer.Write(AutoPvP.SeasonSchedule.Enabled);
							});

						writer.WriteBlock(w => writer.WriteType(Rewards, t => Rewards.Serialize(w)));
					}
					break;
			}
		}
開發者ID:jasegiffin,項目名稱:JustUO,代碼行數:33,代碼來源:SeasonOpts.cs

示例10: Serialize

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

			int version = writer.SetVersion(1);

			switch (version)
			{
				case 1:
					{
						writer.WriteFlag(Access);
						writer.Write(LoginPopup);
					}
					goto case 0;
				case 0:
					{
						writer.Write(DefaultWidth);
						writer.Write(DefaultHeight);
						writer.Write(PositionCommand);
						writer.Write(PopupCommand);

						writer.WriteBlock(Toolbars.DefaultEntries.Serialize);
					}
					break;
			}
		}
開發者ID:jasegiffin,項目名稱:JustUO,代碼行數:26,代碼來源:SystemOpts.cs

示例11: 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

示例12: SerializeBattle

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

			switch (version)
			{
				case 0:
					{
						writer.WriteBlock(w => w.WriteType(key, t => key.Serialize(w)));
						writer.WriteBlock(w => w.WriteType(val, t => val.Serialize(w)));
					}
					break;
			}

			return true;
		}
開發者ID:greeduomacro,項目名稱:RuneUO,代碼行數:16,代碼來源:AutoPvP_Init.cs

示例13: Serialize

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

			if (version > 5)
			{
				writer.WriteBlock(
					w =>
					{
						if (version > 6)
						{
							Serial.Serialize(w);
						}
						else
						{
							w.WriteType(Serial, t => Serial.Serialize(w));
						}
					});
			}

			switch (version)
			{
				case 7:
				case 6:
				case 5:
					writer.Write(Hidden);
					goto case 4;
				case 4:
					writer.Write(FloorItemDelete);
					goto case 3;
				case 3:
				case 2:
					writer.Write(Gate);
					goto case 1;
				case 1:
					{
						writer.Write(Category);
						writer.Write(Ranked);
						writer.Write(InviteWhileRunning);
					}
					goto case 0;
				case 0:
					{
						if (version < 6)
						{
							writer.WriteBlock(w => w.WriteType(Serial, t => Serial.Serialize(w)));
						}

						writer.Write(DebugMode);
						writer.WriteFlag(State);
						writer.Write(Name);
						writer.Write(Description);
						writer.Write(AutoAssign);
						writer.Write(UseTeamColors);
						writer.Write(IgnoreCapacity);
						writer.Write(SubCommandPrefix);
						writer.Write(QueueAllowed);
						writer.Write(SpectateAllowed);
						writer.Write(KillPoints);
						writer.Write(PointsBase);
						writer.Write(PointsRankFactor);
						writer.Write(IdleKick);
						writer.Write(IdleThreshold);
						writer.WriteFlag(LastState);
						writer.Write(LastStateChange);
						writer.Write(LightLevel);
						writer.Write(LogoutDelay);
						writer.WriteItemList(Doors, true);

						writer.WriteBlock(w => w.WriteType(Options, t => Options.Serialize(w)));
						writer.WriteBlock(w => w.WriteType(Schedule, t => Schedule.Serialize(w)));
						writer.WriteBlock(w => w.WriteType(BattleRegion, t => BattleRegion.Serialize(w)));
						writer.WriteBlock(w => w.WriteType(SpectateRegion, t => SpectateRegion.Serialize(w)));

						writer.WriteBlockList(Teams, (w, team) => w.WriteType(team, t => team.Serialize(w)));
					}
					break;
			}
		}
開發者ID:greeduomacro,項目名稱:RuneUO,代碼行數:79,代碼來源:Battle_Serialize.cs

示例14: Serialize

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

			var version = writer.SetVersion(0);

			switch (version)
			{
				case 0:
				{
					writer.WriteBlock(w => w.WriteType(Broadcasts, t => Broadcasts.Serialize(w)));
					writer.WriteBlock(w => w.WriteType(Locations, t => Locations.Serialize(w)));
					writer.WriteBlock(w => w.WriteType(Restrictions, t => Restrictions.Serialize(w)));
					writer.WriteBlock(w => w.WriteType(Rewards, t => Rewards.Serialize(w)));
					writer.WriteBlock(w => w.WriteType(Rules, t => Rules.Serialize(w)));
					writer.WriteBlock(w => w.WriteType(Sounds, t => Sounds.Serialize(w)));
					writer.WriteBlock(w => w.WriteType(SuddenDeath, t => SuddenDeath.Serialize(w)));
					writer.WriteBlock(w => w.WriteType(Timing, t => Timing.Serialize(w)));
					writer.WriteBlock(w => w.WriteType(Weather, t => Weather.Serialize(w)));
				}
					break;
			}
		}
開發者ID:Ravenwolfe,項目名稱:Core,代碼行數:23,代碼來源:Options.cs

示例15: SerializeProfiles

		private static bool SerializeProfiles(GenericWriter writer, IAccount key, DonationProfile val)
		{
			var version = writer.SetVersion(1);

			writer.WriteBlock(
				w =>
				{
					w.Write(key);

					switch (version)
					{
						case 1:
							val.Serialize(w);
							break;
						case 0:
							w.WriteType(val, t => val.Serialize(w));
							break;
					}
				});

			return true;
		}
開發者ID:Ravenwolfe,項目名稱:Core,代碼行數:22,代碼來源:AutoDonate_Init.cs


注:本文中的Server.GenericWriter.WriteBlock方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。