本文整理汇总了C#中Server.GenericWriter.WriteBlockDictionary方法的典型用法代码示例。如果您正苦于以下问题:C# GenericWriter.WriteBlockDictionary方法的具体用法?C# GenericWriter.WriteBlockDictionary怎么用?C# GenericWriter.WriteBlockDictionary使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.GenericWriter
的用法示例。
在下文中一共展示了GenericWriter.WriteBlockDictionary方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SerializeScores
private static bool SerializeScores(GenericWriter writer)
{
writer.SetVersion(0);
writer.WriteBlockDictionary(
Registry,
(e, list) =>
{
writer.WriteEntity(e);
writer.WriteBlockDictionary(
list,
(k, v) =>
{
writer.Write(k);
writer.Write(v);
});
});
return true;
}
示例2: Serialize
private static bool Serialize(GenericWriter writer)
{
writer.WriteBlockDictionary(
Registry,
(name, players) =>
{
writer.Write(name);
writer.WriteMobileList(players, true);
});
return true;
}
示例3: Serialize
private static bool Serialize(GenericWriter writer)
{
writer.SetVersion(0);
writer.WriteBlockDictionary(
Settings,
(w, k, v) =>
{
w.WriteType(k);
v.Serialize(w);
});
return true;
}
示例4: Serialize
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
int version = writer.SetVersion(1);
switch (version)
{
case 1:
writer.Write(Desc);
goto case 0;
case 0:
{
writer.WriteType(Type);
writer.Write(Name);
writer.Write(CanIgnore);
writer.WriteBlockDictionary(States, (w, k, v) => v.Serialize(w));
}
break;
}
}
示例5: Serialize
private static bool Serialize(GenericWriter writer)
{
int version = writer.SetVersion(0);
switch (version)
{
case 0:
{
writer.WriteBlockDictionary(
_States,
(w, k, v) =>
{
w.Write(k);
w.Write(v.Item1);
w.Write(v.Item2.X);
w.Write(v.Item2.Y);
});
}
break;
}
return true;
}
示例6: Serialize
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
writer.SetVersion(0);
writer.Write(Name);
writer.Write(Summary);
writer.Write(Token);
writer.Write(Available);
writer.Write(AutoJoin);
writer.WriteFlag(Access);
writer.WriteFlag(ProfanityAction);
writer.WriteFlag(TextColor);
writer.Write(TextHue);
writer.Write(UserLimit);
writer.Write(SpamDelay);
writer.WriteBlockDictionary(
Bans,
(w, k, v) =>
{
w.Write(k);
w.Write(v);
});
}
示例7: SerializeProfiles
private static bool SerializeProfiles(GenericWriter writer)
{
int version = writer.SetVersion(0);
switch (version)
{
case 0:
{
writer.WriteBlockDictionary(
Profiles,
(w, key, val) =>
{
w.Write(key);
w.WriteType(val, t => val.Serialize(w));
});
}
break;
}
return true;
}
示例8: Serialize
public void Serialize(GenericWriter writer)
{
int version = writer.SetVersion(0);
switch (version)
{
case 0:
{
writer.Write(Owner);
writer.Write(Deleted);
if (!Deleted)
{
writer.WriteBlockDictionary(
History,
(w1, k, v) =>
{
w1.Write(k.Stamp);
w1.WriteBlockList(v, (w2, e) => e.Serialize(w2));
});
}
}
break;
}
}
示例9: SerializeStats
private static bool SerializeStats(GenericWriter writer)
{
int version = writer.SetVersion(0);
switch (version)
{
case 0:
{
writer.WriteBlockDictionary(
Stats,
(w, k, v) =>
{
w.Write(k);
v.Serialize(w);
});
}
break;
}
return true;
}
示例10: Serialize
public static bool Serialize(GenericWriter writer)
{
var version = writer.SetVersion(0);
switch (version)
{
case 0:
{
if (DefaultEntries == null)
{
writer.Write(false);
}
else
{
writer.Write(true);
DefaultEntries.Serialize(writer);
}
writer.WriteBlockDictionary(
Profiles,
(w, k, v) =>
{
w.Write(k);
v.Serialize(w);
});
}
break;
}
return true;
}
示例11: SerializeVoteSites
private static bool SerializeVoteSites(GenericWriter writer)
{
int version = writer.SetVersion(0);
switch (version)
{
case 0:
writer.WriteBlockDictionary(VoteSites, (w, k, v) => w.WriteType(v, t => v.Serialize(w)));
break;
}
return true;
}
示例12: Serialize
public virtual void Serialize(GenericWriter writer)
{
int version = writer.SetVersion(0);
switch (version)
{
case 0:
writer.WriteBlockDictionary(Entries, (w, k, e) => w.WriteType(e, t => e.Serialize(w)));
break;
}
}
示例13: SerializeSeasons
private static bool SerializeSeasons(GenericWriter writer)
{
int version = writer.SetVersion(0);
switch (version)
{
case 0:
{
writer.WriteBlockDictionary(
Seasons,
(key, val) =>
{
writer.Write(key);
writer.WriteType(
val,
t =>
{
if (t != null)
{
val.Serialize(writer);
}
});
});
}
break;
}
return true;
}
示例14: SerializeTransactions
private static bool SerializeTransactions(GenericWriter writer)
{
writer.SetVersion(0);
writer.WriteBlockDictionary(Transactions, (w, k, v) => v.Serialize(w));
return true;
}
示例15: SerializeVoteSites
private static bool SerializeVoteSites(GenericWriter writer)
{
int version = writer.SetVersion(0);
switch (version)
{
case 0:
{
writer.WriteBlockDictionary(
VoteSites,
(k, v) => writer.WriteType(
v,
t =>
{
if (t != null)
{
v.Serialize(writer);
}
}));
}
break;
}
return true;
}