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


C# GenericReader.ReadBlockDictionary方法代碼示例

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


在下文中一共展示了GenericReader.ReadBlockDictionary方法的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: Deserialize

		private static bool Deserialize(GenericReader reader)
		{
			reader.ReadBlockDictionary(
				() =>
				{
					string name = reader.ReadString();
					var players = reader.ReadStrongMobileList<PlayerMobile>();
					return new KeyValuePair<string, List<PlayerMobile>>(name, players);
				});

			return true;
		}
開發者ID:greeduomacro,項目名稱:UO-Forever,代碼行數:12,代碼來源:PlayerNames_Init.cs

示例2: DeserializePlayerScores

		private static bool DeserializePlayerScores(GenericReader reader)
		{
			reader.GetVersion();

			reader.ReadBlockDictionary(
				() =>
				{
					IEntity e = reader.ReadEntity();

					Dictionary<Mobile, double> list = reader.ReadBlockDictionary(
						() =>
						{
							Mobile k = reader.ReadMobile();
							double v = reader.ReadDouble();

							return new KeyValuePair<Mobile, double>(k, v);
						});

					return new KeyValuePair<IEntity, Dictionary<Mobile, double>>(e, list);
				},
				Registry);

			return true;
		}
開發者ID:greeduomacro,項目名稱:UO-Forever,代碼行數:24,代碼來源:PlayerScores_Init.cs

示例3: Deserialize

		private static bool Deserialize(GenericReader reader)
		{
			reader.GetVersion();

			reader.ReadBlockDictionary(
				r =>
				{
					var k = r.ReadAccount();
					var v = new TimeBoostProfile(r);

					return new KeyValuePair<IAccount, TimeBoostProfile>(k, v);
				},
				Profiles);

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

示例4: DeserializeSeasons

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

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

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

示例5: Deserialize

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

			switch (version)
			{
				case 0:
					{
						Owner = reader.ReadMobile<PlayerMobile>();
						Deleted = reader.ReadBool();

						if (!Deleted)
						{
							History = reader.ReadBlockDictionary(
								r1 =>
								{
									TimeStamp k = r1.ReadDouble();
									var v = r1.ReadBlockArray(r2 => new VoteProfileEntry(r2)).Where(e => e.VoteSite != null).ToList();

									return new KeyValuePair<TimeStamp, List<VoteProfileEntry>>(k, v);
								});
						}
					}
					break;
			}
		}
開發者ID:greeduomacro,項目名稱:RuneUO,代碼行數:26,代碼來源:VoteProfile.cs

示例6: Deserialize

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

			switch (version)
			{
				case 0:
				{
					Owner = reader.ReadMobile<PlayerMobile>();
					Deleted = reader.ReadBool();

					if (!Deleted)
					{
						History = reader.ReadBlockDictionary(
							r1 =>
							{
								TimeStamp k = r1.ReadDouble();
								var v = r1.ReadBlockList(r2 => new VoteProfileEntry(r2));

								return new KeyValuePair<TimeStamp, List<VoteProfileEntry>>(k, v);
							});
					}
				}
					break;
			}

			if (History != null)
			{
				foreach (var h in History.Values)
				{
					h.Prune(true, e => e.VoteSite);
				}
			}
		}
開發者ID:Ravenwolfe,項目名稱:Core,代碼行數:34,代碼來源:VoteProfile.cs

示例7: Deserialize

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

			int version = reader.GetVersion();

			switch (version)
			{
				case 1:
					Desc = reader.ReadString();
					goto case 0;
				case 0:
					{
						Type = reader.ReadType();
						Name = reader.ReadString();
						CanIgnore = reader.ReadBool();

						States = reader.ReadBlockDictionary(
							r =>
							{
								var state = new NotifySettingsState(this, r);

								return new KeyValuePair<PlayerMobile, NotifySettingsState>(state.Owner, state);
							});
					}
					break;
			}
		}
開發者ID:greeduomacro,項目名稱:RuneUO,代碼行數:28,代碼來源:Settings.cs

示例8: LoadSets

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

			switch (version)
			{
				case 0:
					{
						reader.ReadBlockDictionary(
							r =>
							{
								EquipmentSet v = r.ReadTypeCreate<EquipmentSet>(r);
								return new KeyValuePair<Type, EquipmentSet>(v.GetType(), v);
							},
							Sets);
					}
					break;
			}

			return true;
		}
開發者ID:jasegiffin,項目名稱:JustUO,代碼行數:21,代碼來源:EquipmentSets_Init.cs

示例9: Deserialize

		private static bool Deserialize(GenericReader reader)
		{
			reader.GetVersion();

			reader.ReadBlockDictionary(
				r =>
				{
					var k = r.ReadType();
					var v = EnsureSettings(k);

					if (v != null)
					{
						v.Deserialize(r);
					}

					return new KeyValuePair<Type, NotifySettings>(k, v);
				},
				Settings);

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

示例10: Deserialize

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

			switch (version)
			{
				case 0:
					{
						reader.ReadBlockDictionary(
							r =>
							{
								DeceitBrazier b = r.ReadItem<DeceitBrazier>();
								Point3D p = r.ReadPoint3D();
								Map m = r.ReadMap();
								return new KeyValuePair<DeceitBrazier, MapPoint>(b, new MapPoint(m, p));
							},
							Registry);
					}
					break;
			}

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

示例11: DeserializeProfiles

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

			switch (version)
			{
				case 0:
					{
						reader.ReadBlockDictionary(
							r =>
							{
								var k = r.ReadMobile<PlayerMobile>();
								var v = new VoteProfile(r);
								return new KeyValuePair<PlayerMobile, VoteProfile>(k, v);
							},
							Profiles);
					}
					break;
			}

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

示例12: DeserializeVoteSites

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

			switch (version)
			{
				case 0:
					{
						reader.ReadBlockDictionary(
							r =>
							{
								var v = r.ReadTypeCreate<IVoteSite>(r);
								return new KeyValuePair<int, IVoteSite>(v.UID, v);
							},
							VoteSites);
					}
					break;
			}

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

示例13: Deserialize

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

			switch (version)
			{
				case 0:
					Entries = reader.ReadBlockDictionary(
						r =>
						{
							PvPProfileHistoryEntry e = r.ReadTypeCreate<PvPProfileHistoryEntry>(r);
							return new KeyValuePair<int, PvPProfileHistoryEntry>(e.Season, e);
						});
					break;
			}
		}
開發者ID:greeduomacro,項目名稱:RuneUO,代碼行數:16,代碼來源:ProfileHistory.cs

示例14: DeserializeTransactions

		private static bool DeserializeTransactions(GenericReader reader)
		{
			reader.GetVersion();

			reader.ReadBlockDictionary(
				r =>
				{
					var t = new DonationTransaction(r);

					return new KeyValuePair<string, DonationTransaction>(t.ID, t);
				},
				Transactions);

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

示例15: Deserialize

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

			switch (version)
			{
				case 0:
				{
					Owner = reader.ReadMobile<PlayerMobile>();
					Deleted = reader.ReadBool();

					if (!Deleted)
					{
						History = reader.ReadBlockDictionary(
							r1 =>
							{
								TimeStamp k = r1.ReadDouble();
								var v = r1.ReadBlockList(r2 => new TrashProfileEntry(r2));
								return new KeyValuePair<TimeStamp, List<TrashProfileEntry>>(k, v);
							});
					}
				}
					break;
			}
		}
開發者ID:Ravenwolfe,項目名稱:Core,代碼行數:25,代碼來源:TrashProfile.cs


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