本文整理匯總了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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
}
示例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);
}
}
}
示例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;
}
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
示例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;
}
}
示例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;
}
示例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;
}
}