本文整理汇总了C#中Server.GenericWriter.WriteType方法的典型用法代码示例。如果您正苦于以下问题:C# GenericWriter.WriteType方法的具体用法?C# GenericWriter.WriteType怎么用?C# GenericWriter.WriteType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.GenericWriter
的用法示例。
在下文中一共展示了GenericWriter.WriteType方法的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);
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;
}
}
示例3: 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;
}
}
示例4: Serialize
private static bool Serialize(GenericWriter writer)
{
writer.SetVersion(0);
writer.WriteBlockDictionary(
Settings,
(k, v) =>
{
writer.WriteType(k);
v.Serialize(writer);
});
return true;
}
示例5: Serialize
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
int version = writer.SetVersion(0);
switch (version)
{
case 0:
{
writer.WriteBlock(
() => writer.WriteType(
Advanced,
t =>
{
if (t != null)
{
Advanced.Serialize(writer);
}
}));
writer.WriteBlock(
() => writer.WriteType(
Statistics,
t =>
{
if (t != null)
{
Statistics.Serialize(writer);
}
}));
writer.WriteBlock(
() => writer.WriteType(
ExecuteCommands,
t =>
{
if (t != null)
{
ExecuteCommands.Serialize(writer);
}
}));
}
break;
}
}
示例6: 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;
}
}
示例7: Serialize
public virtual void Serialize(GenericWriter writer)
{
int version = writer.SetVersion(0);
switch (version)
{
case 0:
{
writer.Write(Enabled);
writer.Write(UID);
writer.WriteFlag(_Priority);
writer.Write(_BonusTokens);
writer.Write(_BonusTokensChance);
writer.WriteList(Accepted, t => writer.WriteType(t));
writer.WriteList(Ignored, t => writer.WriteType(t));
}
break;
}
}
示例8: Serialize
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
int version = writer.SetVersion(0);
switch (version)
{
case 0:
{
writer.Write(Name);
writer.Write(Display);
writer.Write(DisplaySet);
writer.WriteType(TypeOf.InternalType);
writer.Write(IncludeChildTypes);
}
break;
}
}
示例9: Serialize
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
int version = writer.SetVersion(3);
switch (version)
{
case 3:
writer.WriteFlag(Level);
goto case 2;
case 2:
writer.Write(RemoveLocked);
goto case 1;
case 1:
{
writer.Write(EditLocked);
writer.Write(AddLocked);
writer.Write(CloneEntryChargeCost);
writer.WriteDictionary(
ChargeTypes,
(k, v) =>
{
writer.WriteType(k);
writer.Write(v);
});
}
goto case 0;
case 0:
{
writer.Write(Charges);
writer.Write(RecallChargeCost);
writer.Write(GateChargeCost);
writer.Write(_Descripton);
Categories.Serialize(writer);
}
break;
}
}
示例10: SerializeBattle
private static bool SerializeBattle(GenericWriter writer, PvPSerial key, PvPBattle val)
{
int version = writer.SetVersion(0);
switch (version)
{
case 0:
{
writer.WriteBlock(
() => writer.WriteType(
key,
t =>
{
if (t != null)
{
key.Serialize(writer);
}
}));
writer.WriteBlock(
() => writer.WriteType(
val,
t =>
{
if (t != null)
{
val.Serialize(writer);
}
}));
}
break;
}
return true;
}
示例11: Serialize
public override void Serialize(GenericWriter writer)
{
base.Serialize(writer);
int version = writer.SetVersion(0);
switch (version)
{
case 0:
{
writer.WriteBlock(
() => writer.WriteType(
Broadcasts,
t =>
{
if (t != null)
{
Broadcasts.Serialize(writer);
}
}));
writer.WriteBlock(
() => writer.WriteType(
Locations,
t =>
{
if (t != null)
{
Locations.Serialize(writer);
}
}));
writer.WriteBlock(
() => writer.WriteType(
Restrictions,
t =>
{
if (t != null)
{
Restrictions.Serialize(writer);
}
}));
writer.WriteBlock(
() => writer.WriteType(
Rewards,
t =>
{
if (t != null)
{
Rewards.Serialize(writer);
}
}));
writer.WriteBlock(
() => writer.WriteType(
Rules,
t =>
{
if (t != null)
{
Rules.Serialize(writer);
}
}));
writer.WriteBlock(
() => writer.WriteType(
Sounds,
t =>
{
if (t != null)
{
Sounds.Serialize(writer);
}
}));
writer.WriteBlock(
() => writer.WriteType(
SuddenDeath,
t =>
{
if (t != null)
{
SuddenDeath.Serialize(writer);
}
}));
writer.WriteBlock(
() => writer.WriteType(
Timing,
t =>
{
if (t != null)
{
Timing.Serialize(writer);
}
}));
writer.WriteBlock(
() => writer.WriteType(
//.........这里部分代码省略.........
示例12: 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);
}
}
示例13: Serialize
public virtual void Serialize(GenericWriter writer)
{
var version = writer.SetVersion(0);
switch (version)
{
case 0:
{
writer.WriteFlag(Months);
writer.WriteFlag(Days);
writer.WriteType(Times, t => Times.Serialize(writer));
}
break;
}
}
示例14: 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;
}
示例15: Serialize
public override void Serialize(GenericWriter writer)
{
writer.Write(VitaNexCore.Version);
base.Serialize(writer);
var version = writer.SetVersion(0);
switch (version)
{
case 0:
writer.WriteType(_ModuleType);
break;
}
}