本文整理汇总了C#中Server.GenericWriter.WriteBlock方法的典型用法代码示例。如果您正苦于以下问题:C# GenericWriter.WriteBlock方法的具体用法?C# GenericWriter.WriteBlock怎么用?C# GenericWriter.WriteBlock使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.GenericWriter
的用法示例。
在下文中一共展示了GenericWriter.WriteBlock方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Serialize
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
int version = writer.SetVersion(0);
switch (version)
{
case 0:
{
writer.WriteBlock(
() => writer.WriteType(
Loser,
t =>
{
if (t != null)
{
Loser.Serialize(writer);
}
}));
writer.WriteBlock(
() => writer.WriteType(
Winner,
t =>
{
if (t != null)
{
Winner.Serialize(writer);
}
}));
}
break;
}
}
示例2: Serialize
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
var version = writer.SetVersion(0);
switch (version)
{
case 0:
{
writer.WriteBlock(w => w.WriteType(Local, t => Local.Serialize(w)));
writer.WriteBlock(w => w.WriteType(World, t => World.Serialize(w)));
}
break;
}
}
示例3: Serialize
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
int version = writer.SetVersion(1);
switch (version)
{
case 1:
{
writer.WriteBlock(
() => writer.WriteType(
Misc,
t =>
{
if (t != null)
{
Misc.Serialize(writer);
}
}));
}
goto case 0;
case 0:
{
writer.WriteBlock(
() => writer.WriteType(
Commands,
t =>
{
if (t != null)
{
Commands.Serialize(writer);
}
}));
writer.WriteBlock(
() => writer.WriteType(
Profiles,
t =>
{
if (t != null)
{
Profiles.Serialize(writer);
}
}));
writer.WriteBlock(
() => writer.WriteType(
Seasons,
t =>
{
if (t != null)
{
Seasons.Serialize(writer);
}
}));
}
break;
}
}
示例4: Serialize
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
int version = writer.SetVersion(0);
switch (version)
{
case 0:
{
writer.WriteBlock(w => w.WriteType(Loser, t => Loser.Serialize(w)));
writer.WriteBlock(w => w.WriteType(Winner, t => Winner.Serialize(w)));
}
break;
}
}
示例5: Serialize
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
int version = writer.SetVersion(0);
switch (version)
{
case 0:
{
writer.WriteBlock(w => w.WriteType(Advanced, t => Advanced.Serialize(w)));
writer.WriteBlock(w => w.WriteType(Statistics, t => Statistics.Serialize(w)));
writer.WriteBlock(w => w.WriteType(ExecuteCommands, t => ExecuteCommands.Serialize(w)));
}
break;
}
}
示例6: Serialize
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
int version = writer.SetVersion(0);
switch (version)
{
case 0:
{
writer.WriteBlock(w => w.WriteType(Items, t => Items.Serialize(w)));
writer.WriteBlock(w => w.WriteType(Pets, t => Pets.Serialize(w)));
writer.WriteBlock(w => w.WriteType(Skills, t => Skills.Serialize(w)));
writer.WriteBlock(w => w.WriteType(Spells, t => Spells.Serialize(w)));
}
break;
}
}
示例7: Serialize
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
int version = writer.SetVersion(0);
switch (version)
{
case 0:
{
writer.WriteBlock(
() => writer.WriteType(
Items,
t =>
{
if (t != null)
{
Items.Serialize(writer);
}
}));
writer.WriteBlock(
() => writer.WriteType(
Pets,
t =>
{
if (t != null)
{
Pets.Serialize(writer);
}
}));
writer.WriteBlock(
() => writer.WriteType(
Skills,
t =>
{
if (t != null)
{
Skills.Serialize(writer);
}
}));
writer.WriteBlock(
() => writer.WriteType(
Spells,
t =>
{
if (t != null)
{
Spells.Serialize(writer);
}
}));
}
break;
}
}
示例8: Serialize
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
int version = writer.SetVersion(1);
switch (version)
{
case 1:
writer.WriteBlock(w => w.WriteType(Misc, t => Misc.Serialize(w)));
goto case 0;
case 0:
{
writer.WriteBlock(w => w.WriteType(Commands, t => Commands.Serialize(w)));
writer.WriteBlock(w => w.WriteType(Profiles, t => Profiles.Serialize(w)));
writer.WriteBlock(w => w.WriteType(Seasons, t => Seasons.Serialize(w)));
}
break;
}
}
示例9: Serialize
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
int version = writer.SetVersion(1);
switch (version)
{
case 1:
{
writer.Write(SkipTicks);
writer.Write(SkippedTicks);
}
goto case 0;
case 0:
{
writer.WriteBlock(
w =>
{
writer.Write(CurrentSeason);
writer.Write(TopListCount);
writer.Write(RunnersUpCount);
writer.WriteType(ScheduleInfo, t => ScheduleInfo.Serialize(w));
writer.Write(AutoPvP.SeasonSchedule.Enabled);
});
writer.WriteBlock(w => writer.WriteType(Rewards, t => Rewards.Serialize(w)));
}
break;
}
}
示例10: Serialize
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
int version = writer.SetVersion(1);
switch (version)
{
case 1:
{
writer.WriteFlag(Access);
writer.Write(LoginPopup);
}
goto case 0;
case 0:
{
writer.Write(DefaultWidth);
writer.Write(DefaultHeight);
writer.Write(PositionCommand);
writer.Write(PopupCommand);
writer.WriteBlock(Toolbars.DefaultEntries.Serialize);
}
break;
}
}
示例11: Serialize
public virtual void Serialize(GenericWriter writer)
{
var version = writer.SetVersion(2);
switch (version)
{
case 2:
case 1:
case 0:
{
if (version < 2)
{
writer.WriteType(_Info, t => _Info.Serialize(writer));
}
else
{
writer.WriteBlock(w => w.WriteType(_Info, t => _Info.Serialize(w)));
}
writer.Write(_Enabled);
writer.Write(_Name);
writer.WriteFlag(_DefaultPriority);
if (_LastGlobalTick != null)
{
writer.Write(true);
writer.Write(_LastGlobalTick.Value);
}
else
{
writer.Write(false);
}
if (_NextGlobalTick != null)
{
writer.Write(true);
writer.Write(_NextGlobalTick.Value);
}
else
{
writer.Write(false);
}
writer.Write(Delay);
writer.Write(Interval);
}
break;
}
if (version > 0)
{
writer.Write(Running);
}
}
示例12: SerializeBattle
private static bool SerializeBattle(GenericWriter writer, PvPSerial key, PvPBattle val)
{
int version = writer.SetVersion(0);
switch (version)
{
case 0:
{
writer.WriteBlock(w => w.WriteType(key, t => key.Serialize(w)));
writer.WriteBlock(w => w.WriteType(val, t => val.Serialize(w)));
}
break;
}
return true;
}
示例13: 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;
}
}
示例14: Serialize
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
var version = writer.SetVersion(0);
switch (version)
{
case 0:
{
writer.WriteBlock(w => w.WriteType(Broadcasts, t => Broadcasts.Serialize(w)));
writer.WriteBlock(w => w.WriteType(Locations, t => Locations.Serialize(w)));
writer.WriteBlock(w => w.WriteType(Restrictions, t => Restrictions.Serialize(w)));
writer.WriteBlock(w => w.WriteType(Rewards, t => Rewards.Serialize(w)));
writer.WriteBlock(w => w.WriteType(Rules, t => Rules.Serialize(w)));
writer.WriteBlock(w => w.WriteType(Sounds, t => Sounds.Serialize(w)));
writer.WriteBlock(w => w.WriteType(SuddenDeath, t => SuddenDeath.Serialize(w)));
writer.WriteBlock(w => w.WriteType(Timing, t => Timing.Serialize(w)));
writer.WriteBlock(w => w.WriteType(Weather, t => Weather.Serialize(w)));
}
break;
}
}
示例15: SerializeProfiles
private static bool SerializeProfiles(GenericWriter writer, IAccount key, DonationProfile val)
{
var version = writer.SetVersion(1);
writer.WriteBlock(
w =>
{
w.Write(key);
switch (version)
{
case 1:
val.Serialize(w);
break;
case 0:
w.WriteType(val, t => val.Serialize(w));
break;
}
});
return true;
}