本文整理匯總了C#中Server.GenericReader.ReadBlockArray方法的典型用法代碼示例。如果您正苦於以下問題:C# GenericReader.ReadBlockArray方法的具體用法?C# GenericReader.ReadBlockArray怎麽用?C# GenericReader.ReadBlockArray使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Server.GenericReader
的用法示例。
在下文中一共展示了GenericReader.ReadBlockArray方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。
示例1: DeserializeChannels
private static void DeserializeChannels(GenericReader reader)
{
reader.GetVersion();
int idx = 0;
reader.ReadBlockArray(
r =>
{
var c = _PermaChannels[idx++];
if (c != null)
{
c.Deserialize(r);
}
return c;
},
_PermaChannels);
reader.ReadBlockList(r => r.ReadTypeCreate<WorldChatChannel>(r), _Channels);
}
示例2: DeserializeProfiles
private static bool DeserializeProfiles(GenericReader reader)
{
var list = reader.ReadBlockArray(() => new TrashProfile(reader));
foreach (var p in list)
{
Profiles.AddOrReplace(p.Owner, p);
}
return true;
}
示例3: 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(
() =>
{
TimeStamp k = reader.ReadDouble();
var v = reader.ReadBlockArray(() => new VoteProfileEntry(reader)).Where(e => (e.VoteSite != null)).ToList();
return new KeyValuePair<TimeStamp, List<VoteProfileEntry>>(k, v);
});
}
}
break;
}
}
示例4: 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;
}