本文整理汇总了C#中Server.GenericWriter.WriteBlockList方法的典型用法代码示例。如果您正苦于以下问题:C# GenericWriter.WriteBlockList方法的具体用法?C# GenericWriter.WriteBlockList怎么用?C# GenericWriter.WriteBlockList使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.GenericWriter
的用法示例。
在下文中一共展示了GenericWriter.WriteBlockList方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: SerializeChannels
private static void SerializeChannels(GenericWriter writer)
{
writer.SetVersion(0);
writer.WriteBlockArray(_PermaChannels, (w, c) => c.Serialize(w));
writer.WriteBlockList(
_Channels,
(w, c) => w.WriteType(
c,
t =>
{
if (t != null)
{
c.Serialize(w);
}
}));
}
示例2: Serialize
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
int version = writer.SetVersion(1);
switch (version)
{
case 1:
SpectateGate.Serialize(writer);
goto case 0;
case 0:
{
writer.Write(Map);
writer.Write(BattlePriority);
Eject.Serialize(writer);
writer.Write(SpectateJoin);
writer.WriteBlockList(BattleBounds, (w, b) => w.Write(b));
writer.WriteBlockList(SpectateBounds, (w, b) => w.Write(b));
}
break;
}
}
示例3: Serialize
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
var version = writer.SetVersion(2);
switch (version)
{
case 2:
writer.Write(NotifyPlayer);
goto case 1;
case 1:
{
writer.WriteFlag(SearchMode);
writer.Write(SearchCapsIgnore);
}
goto case 0;
case 0:
{
writer.WriteBlockList(WhitespaceAliases, (w, a) => w.Write(a));
writer.WriteBlockList(KeyWords, (w, k) => w.Write(k));
writer.Write(LogEnabled);
writer.Write(ConsoleWrite);
writer.Write(PageStaff);
writer.Write(NotifyStaff);
writer.WriteFlag(NotifyAccess);
writer.Write(Jail);
JailPoint.Serialize(writer);
writer.Write(Squelch);
writer.Write(Kick);
writer.Write(Ban);
}
break;
}
}
示例4: Serialize
public virtual void Serialize(GenericWriter writer)
{
int version = writer.SetVersion(7);
if (version > 5)
{
writer.WriteBlock(
w =>
{
if (version > 6)
{
Serial.Serialize(w);
}
else
{
w.WriteType(Serial, t => Serial.Serialize(w));
}
});
}
switch (version)
{
case 7:
case 6:
case 5:
writer.Write(Hidden);
goto case 4;
case 4:
writer.Write(FloorItemDelete);
goto case 3;
case 3:
case 2:
writer.Write(Gate);
goto case 1;
case 1:
{
writer.Write(Category);
writer.Write(Ranked);
writer.Write(InviteWhileRunning);
}
goto case 0;
case 0:
{
if (version < 6)
{
writer.WriteBlock(w => w.WriteType(Serial, t => Serial.Serialize(w)));
}
writer.Write(DebugMode);
writer.WriteFlag(State);
writer.Write(Name);
writer.Write(Description);
writer.Write(AutoAssign);
writer.Write(UseTeamColors);
writer.Write(IgnoreCapacity);
writer.Write(SubCommandPrefix);
writer.Write(QueueAllowed);
writer.Write(SpectateAllowed);
writer.Write(KillPoints);
writer.Write(PointsBase);
writer.Write(PointsRankFactor);
writer.Write(IdleKick);
writer.Write(IdleThreshold);
writer.WriteFlag(LastState);
writer.Write(LastStateChange);
writer.Write(LightLevel);
writer.Write(LogoutDelay);
writer.WriteItemList(Doors, true);
writer.WriteBlock(w => w.WriteType(Options, t => Options.Serialize(w)));
writer.WriteBlock(w => w.WriteType(Schedule, t => Schedule.Serialize(w)));
writer.WriteBlock(w => w.WriteType(BattleRegion, t => BattleRegion.Serialize(w)));
writer.WriteBlock(w => w.WriteType(SpectateRegion, t => SpectateRegion.Serialize(w)));
writer.WriteBlockList(Teams, (w, team) => w.WriteType(team, t => team.Serialize(w)));
}
break;
}
}
示例5: SerializeReports
private static void SerializeReports(GenericWriter writer)
{
writer.SetVersion(0);
writer.WriteBlockList(Reports, (w, r) => r.Serialize(w));
}
示例6: 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,
(k, v) =>
{
writer.Write(k.Stamp);
writer.WriteBlockList(v, e => e.Serialize(writer));
});
}
}
break;
}
}
示例7: SerializeHandlers
private static bool SerializeHandlers(GenericWriter writer)
{
writer.WriteBlockList(
new List<BaseTrashHandler>(Handlers.Values),
obj => writer.WriteType(
obj,
t =>
{
if (t != null)
{
obj.Serialize(writer);
}
}));
return true;
}