本文整理汇总了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;
}