本文整理汇总了C#中GenericReader.ReadBlockDictionary方法的典型用法代码示例。如果您正苦于以下问题:C# GenericReader.ReadBlockDictionary方法的具体用法?C# GenericReader.ReadBlockDictionary怎么用?C# GenericReader.ReadBlockDictionary使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GenericReader
的用法示例。
在下文中一共展示了GenericReader.ReadBlockDictionary方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DeserializeDonationProfiles
private static bool DeserializeDonationProfiles(GenericReader reader)
{
reader.GetVersion();
reader.ReadBlockDictionary(
() =>
{
var e = reader.ReadString();
var p = new DonationProfile(reader);
return new KeyValuePair<string, DonationProfile>(e, p);
},
DonationProfiles);
return true;
}
示例2: DeserializePlayerProfiles
private static bool DeserializePlayerProfiles(GenericReader reader)
{
reader.GetVersion();
reader.ReadBlockDictionary(
() =>
{
var e = reader.ReadMobile<PlayerMobile>();
var p = new PlayerZombieProfile(reader);
return new KeyValuePair<PlayerMobile, PlayerZombieProfile>(e, p);
},
PlayerProfiles);
return true;
}
示例3: DeserializeZombieEvent
private static bool DeserializeZombieEvent(GenericReader reader)
{
reader.GetVersion();
reader.ReadBlockDictionary(
() =>
{
var c = reader.ReadTypeCreate<ZombieInstance>(reader);
ZombieInstanceSerial s = c != null ? c.Uid : null;
return new KeyValuePair<ZombieInstanceSerial, ZombieInstance>(s, c);
},
ZombieEvents);
return true;
}
示例4: DeserializePlayerProfiles
private static bool DeserializePlayerProfiles(GenericReader reader)
{
reader.GetVersion();
reader.ReadBlockDictionary(
() =>
{
var e = reader.ReadMobile<PlayerMobile>();
var p = new PlayerEventScoreProfile(reader);
if (p.DisplayCharacter == null)
{
p.DisplayCharacter = e;
}
return new KeyValuePair<PlayerMobile, PlayerEventScoreProfile>(e, p);
},
PlayerProfiles);
return true;
}
示例5: DeserializeInvasions
private static bool DeserializeInvasions(GenericReader reader)
{
reader.GetVersion();
reader.ReadBlockDictionary(
() =>
{
var c = reader.ReadTypeCreate<Invasion>(reader);
InvasionSerial s = c != null ? c.UID : null;
return new KeyValuePair<InvasionSerial, Invasion>(s, c);
},
Invasions);
return true;
}
示例6: DeserializeProfiles
private static bool DeserializeProfiles(GenericReader reader)
{
int version = reader.GetVersion();
switch (version)
{
case 1:
{
ConquestProfile[] list = reader.ReadBlockArray(() => new ConquestProfile(reader));
foreach (ConquestProfile p in list)
{
Profiles.AddOrReplace(p.Owner, p);
}
}
break;
case 0:
{
reader.ReadBlockDictionary(
() =>
{
var p = new ConquestProfile(reader);
PlayerMobile s = p.Owner;
return new KeyValuePair<PlayerMobile, ConquestProfile>(s, p);
},
Profiles);
}
break;
}
return true;
}
示例7: DeserializeConquestRegistry
private static bool DeserializeConquestRegistry(GenericReader reader)
{
int version = reader.GetVersion();
switch (version)
{
case 0:
{
reader.ReadBlockDictionary(
() =>
{
var c = reader.ReadTypeCreate<Conquest>(reader);
ConquestSerial s = c != null ? c.UID : null;
return new KeyValuePair<ConquestSerial, Conquest>(s, c);
},
ConquestRegistry);
}
break;
}
return true;
}
示例8: DeserializePortals
private static bool DeserializePortals(GenericReader reader)
{
reader.GetVersion();
reader.ReadBlockDictionary(
() =>
{
var c = reader.ReadTypeCreate<Portal>(reader);
PortalSerial s = c != null ? c.UID : null;
return new KeyValuePair<PortalSerial, Portal>(s, c);
},
PortalList);
return true;
}
示例9: DeserializeCams
private static void DeserializeCams(GenericReader reader)
{
int version = reader.GetVersion();
switch (version)
{
case 3: // Skip to case 1
goto case 1;
case 2:
{
reader.ReadBlockDictionary(
() =>
{
var cam = reader.ReadMobile<PlayerMobile>();
var viewed = reader.ReadMobile<PlayerMobile>();
return new KeyValuePair<PlayerMobile, PlayerMobile>(cam, viewed);
},
CurrentlyViewing);
}
goto case 1;
case 1:
{
reader.ReadBlockDictionary(
() =>
{
var player = reader.ReadMobile<PlayerMobile>();
int count = reader.ReadInt();
return new KeyValuePair<PlayerMobile, int>(player, count);
},
PlayerMurderers);
reader.ReadBlockDictionary(
() =>
{
BaseCreature mob = reader.ReadMobile<BaseCreature>();
int count = reader.ReadInt();
return new KeyValuePair<BaseCreature, int>(mob, count);
},
MonsterMurderers);
CurrentDeathCount = reader.ReadULong();
CurrentPlayerMurders = reader.ReadULong();
CurrentMonsterMurders = reader.ReadULong();
}
goto case 0;
case 0:
{
if (version < 1)
{
CurrentDeathCount = Convert.ToUInt64(reader.ReadInt());
CurrentPlayerMurders = Convert.ToUInt64(reader.ReadInt());
CurrentMonsterMurders = Convert.ToUInt64(reader.ReadInt());
}
TopPlayerMurderer = reader.ReadMobile<PlayerMobile>();
TopMonsterMurderer = reader.ReadMobile<BaseCreature>();
if (version < 1)
{
reader.ReadBlockDictionary(
() =>
{
var player = reader.ReadMobile<PlayerMobile>();
DateTime date = reader.ReadDateTime();
return new KeyValuePair<PlayerMobile, DateTime>(player, date);
},
DeathCams);
reader.ReadBlockDictionary(
() =>
{
var player = reader.ReadMobile<PlayerMobile>();
DateTime date = reader.ReadDateTime();
return new KeyValuePair<PlayerMobile, DateTime>(player, date);
},
DeathCamsEvents);
}
}
break;
}
}
示例10: DeserializeTemplates
private static bool DeserializeTemplates(GenericReader reader)
{
int version = reader.GetVersion();
switch (version)
{
case 0:
{
reader.ReadBlockDictionary(
() =>
{
var key = reader.ReadMobile<PlayerMobile>();
var val = new TemplateProfile(reader);
return new KeyValuePair<PlayerMobile, TemplateProfile>(key, val);
},
Templates);
}
break;
}
return true;
}
示例11: DeserializeProfiles
private static bool DeserializeProfiles(GenericReader reader)
{
int version = reader.GetVersion();
switch (version)
{
case 0:
{
reader.ReadBlockDictionary(
() =>
{
var p = new TitleProfile(reader);
PlayerMobile s = p.Owner;
return new KeyValuePair<PlayerMobile, TitleProfile>(s, p);
},
Profiles);
}
break;
}
return true;
}
示例12: DeserializeHueRegistry
private static bool DeserializeHueRegistry(GenericReader reader)
{
int version = reader.GetVersion();
switch (version)
{
case 0:
{
reader.ReadBlockDictionary(
() =>
{
var h = new TitleHue(reader);
TitleObjectSerial s = h.UID;
return new KeyValuePair<TitleObjectSerial, TitleHue>(s, h);
},
HueRegistry);
}
break;
}
return true;
}