本文整理汇总了C#中Server.GenericReader.ReadTypeCreate方法的典型用法代码示例。如果您正苦于以下问题:C# GenericReader.ReadTypeCreate方法的具体用法?C# GenericReader.ReadTypeCreate怎么用?C# GenericReader.ReadTypeCreate使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Server.GenericReader
的用法示例。
在下文中一共展示了GenericReader.ReadTypeCreate方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Deserialize
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
var version = reader.GetVersion();
switch (version)
{
case 0:
{
reader.ReadBlock(r => Local = reader.ReadTypeCreate<PvPBattleLocalBroadcasts>(r) ?? new PvPBattleLocalBroadcasts());
reader.ReadBlock(r => World = reader.ReadTypeCreate<PvPBattleWorldBroadcasts>(r) ?? new PvPBattleWorldBroadcasts());
}
break;
}
}
示例2: Deserialize
public virtual void Deserialize(GenericReader reader)
{
var version = reader.GetVersion();
switch (version)
{
case 2:
case 1:
case 0:
{
if (version < 2)
{
_Info = reader.ReadTypeCreate<ScheduleInfo>(reader) ?? new ScheduleInfo();
}
else
{
reader.ReadBlock(r => _Info = r.ReadTypeCreate<ScheduleInfo>(r) ?? new ScheduleInfo());
}
_Enabled = reader.ReadBool();
_Name = reader.ReadString();
_DefaultPriority = reader.ReadFlag<TimerPriority>();
if (reader.ReadBool())
{
_LastGlobalTick = reader.ReadDateTime();
}
if (reader.ReadBool())
{
_NextGlobalTick = reader.ReadDateTime();
}
Delay = reader.ReadTimeSpan();
Interval = reader.ReadTimeSpan();
}
break;
}
if (version > 0)
{
Running = reader.ReadBool();
}
}
示例3: Deserialize
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.GetVersion();
switch (version)
{
case 0:
{
reader.ReadBlock(
r => Items = reader.ReadTypeCreate<PvPBattleItemRestrictions>(r) ?? new PvPBattleItemRestrictions(r));
reader.ReadBlock(
r => Pets = reader.ReadTypeCreate<PvPBattlePetRestrictions>(r) ?? new PvPBattlePetRestrictions(r));
reader.ReadBlock(
r => Skills = reader.ReadTypeCreate<PvPBattleSkillRestrictions>(r) ?? new PvPBattleSkillRestrictions(r));
reader.ReadBlock(
r => Spells = reader.ReadTypeCreate<PvPBattleSpellRestrictions>(r) ?? new PvPBattleSpellRestrictions(r));
}
break;
}
}
示例4: Deserialize
public virtual void Deserialize(GenericReader reader)
{
var version = reader.ReadInt();
switch (version)
{
case 0:
{
Months = reader.ReadFlag<ScheduleMonths>();
Days = reader.ReadFlag<ScheduleDays>();
Times = reader.ReadTypeCreate<ScheduleTimes>(reader) ?? new ScheduleTimes();
}
break;
}
}
示例5: Deserialize
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.GetVersion();
switch (version)
{
case 0:
{
reader.ReadBlock(
() => { Advanced = reader.ReadTypeCreate<AutoPvPAdvancedOptions>(reader) ?? new AutoPvPAdvancedOptions(reader); });
reader.ReadBlock(
() => { Statistics = reader.ReadTypeCreate<AutoPvPStatistics>(reader) ?? new AutoPvPStatistics(reader); });
reader.ReadBlock(
() =>
{ ExecuteCommands = reader.ReadTypeCreate<AutoPvPExecuteCommands>(reader) ?? new AutoPvPExecuteCommands(reader); });
}
break;
}
}
示例6: Deserialize
public virtual void Deserialize(GenericReader reader)
{
int version = reader.GetVersion();
switch (version)
{
case 1:
case 0:
{
_Info = reader.ReadTypeCreate<ScheduleInfo>(reader) ?? new ScheduleInfo(reader);
_Enabled = reader.ReadBool();
_Name = reader.ReadString();
_DefaultPriority = reader.ReadFlag<TimerPriority>();
if (reader.ReadBool())
{
_LastGlobalTick = reader.ReadDateTime();
}
if (reader.ReadBool())
{
_NextGlobalTick = reader.ReadDateTime();
}
Delay = reader.ReadTimeSpan();
Interval = reader.ReadTimeSpan();
}
break;
}
if (version < 1)
{
return;
}
if (reader.ReadBool() && _Enabled)
{
Running = true;
}
}
示例7: DeserializeBattle
private static Tuple<PvPSerial, PvPBattle> DeserializeBattle(GenericReader reader)
{
PvPSerial key = null;
PvPBattle val = null;
int version = reader.GetVersion();
switch (version)
{
case 0:
{
reader.ReadBlock(() => key = reader.ReadTypeCreate<PvPSerial>(reader));
reader.ReadBlock(() => val = reader.ReadTypeCreate<PvPBattle>(reader));
}
break;
}
if (key == null)
{
if (val != null && val.Serial != null)
{
key = val.Serial;
}
else
{
return null;
}
}
return new Tuple<PvPSerial, PvPBattle>(key, val);
}
示例8: Deserialize
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.GetVersion();
switch (version)
{
case 0:
{
reader.ReadBlock(
() => { Broadcasts = reader.ReadTypeCreate<PvPBattleBroadcasts>(reader) ?? new PvPBattleBroadcasts(reader); });
reader.ReadBlock(
() => { Locations = reader.ReadTypeCreate<PvPBattleLocations>(reader) ?? new PvPBattleLocations(reader); });
reader.ReadBlock(
() => { Restrictions = reader.ReadTypeCreate<PvPBattleRestrictions>(reader) ?? new PvPBattleRestrictions(reader); });
reader.ReadBlock(() => { Rewards = reader.ReadTypeCreate<PvPRewards>(reader) ?? new PvPRewards(reader); });
reader.ReadBlock(() => { Rules = reader.ReadTypeCreate<PvPBattleRules>(reader) ?? new PvPBattleRules(reader); });
reader.ReadBlock(() => { Sounds = reader.ReadTypeCreate<PvPBattleSounds>(reader) ?? new PvPBattleSounds(reader); });
reader.ReadBlock(
() => { SuddenDeath = reader.ReadTypeCreate<PvPBattleSuddenDeath>(reader) ?? new PvPBattleSuddenDeath(reader); });
reader.ReadBlock(() => { Timing = reader.ReadTypeCreate<PvPBattleTiming>(reader) ?? new PvPBattleTiming(reader); });
reader.ReadBlock(() => { Weather = reader.ReadTypeCreate<PvPBattleWeather>(reader) ?? new PvPBattleWeather(reader); });
}
break;
}
}
示例9: DeserializeSeasons
private static bool DeserializeSeasons(GenericReader reader)
{
int version = reader.GetVersion();
switch (version)
{
case 0:
{
reader.ReadBlockDictionary(
() =>
{
int key = reader.ReadInt();
PvPSeason val = reader.ReadTypeCreate<PvPSeason>(reader) ?? new PvPSeason(key);
return new KeyValuePair<int, PvPSeason>(key, val);
},
Seasons);
}
break;
}
return true;
}
示例10: Deserialize
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.GetVersion();
switch (version)
{
case 1:
{
reader.ReadBlock(() => { Misc = reader.ReadTypeCreate<AutoPvPMiscOptions>(reader) ?? new AutoPvPMiscOptions(reader); });
}
goto case 0;
case 0:
{
if (version == 0)
{
Misc = new AutoPvPMiscOptions();
}
reader.ReadBlock(
() => { Commands = reader.ReadTypeCreate<AutoPvPCommandOptions>(reader) ?? new AutoPvPCommandOptions(reader); });
reader.ReadBlock(
() => { Profiles = reader.ReadTypeCreate<AutoPvPProfileOptions>(reader) ?? new AutoPvPProfileOptions(reader); });
reader.ReadBlock(
() => { Seasons = reader.ReadTypeCreate<AutoPvPSeasonOptions>(reader) ?? new AutoPvPSeasonOptions(reader); });
}
break;
}
}
示例11: DeserializeVoteSites
private static bool DeserializeVoteSites(GenericReader reader)
{
int version = reader.GetVersion();
switch (version)
{
case 0:
{
reader.ReadBlockDictionary(
() =>
{
var v = reader.ReadTypeCreate<IVoteSite>(reader);
return new KeyValuePair<int, IVoteSite>(v.UID, v);
},
VoteSites);
}
break;
}
return true;
}
示例12: DeserializeHandlers
private static bool DeserializeHandlers(GenericReader reader)
{
var list = reader.ReadBlockArray(() => reader.ReadTypeCreate<BaseTrashHandler>(reader));
list.ForEach(
h =>
{
if (!Handlers.ContainsKey(h.UID))
{
Handlers.Add(h.UID, h);
}
else
{
Handlers[h.UID] = h;
}
});
InternalHandlerSort();
return true;
}
示例13: Deserialize
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.GetVersion();
switch (version)
{
case 0:
{
reader.ReadBlock(() => { Loser = reader.ReadTypeCreate<PvPReward>(reader) ?? new PvPReward(reader); });
reader.ReadBlock(() => { Winner = reader.ReadTypeCreate<PvPReward>(reader) ?? new PvPReward(reader); });
}
break;
}
}
示例14: Deserialize
public virtual void Deserialize(GenericReader reader)
{
int version = reader.GetVersion();
if (version > 5)
{
reader.ReadBlock(() =>
{
if (version > 6)
{
Serial = new PvPSerial(reader);
}
else
{
Serial = reader.ReadTypeCreate<PvPSerial>(reader) ?? new PvPSerial(reader);
}
});
}
switch (version)
{
case 7:
case 6:
case 5:
Hidden = reader.ReadBool();
goto case 4;
case 4:
FloorItemDelete = reader.ReadBool();
goto case 3;
case 3:
case 2:
{
Gate = reader.ReadItem<PvPSpectatorGate>();
if (Gate != null)
{
Gate.Battle = this;
}
}
goto case 1;
case 1:
{
Category = reader.ReadString();
Ranked = reader.ReadBool();
InviteWhileRunning = reader.ReadBool();
}
goto case 0;
case 0:
{
if (version < 6)
{
reader.ReadBlock(() => Serial = reader.ReadTypeCreate<PvPSerial>(reader) ?? new PvPSerial());
}
DebugMode = reader.ReadBool();
State = reader.ReadFlag<PvPBattleState>();
Name = reader.ReadString();
Description = reader.ReadString();
AutoAssign = reader.ReadBool();
UseTeamColors = reader.ReadBool();
IgnoreCapacity = reader.ReadBool();
SubCommandPrefix = reader.ReadChar();
QueueAllowed = reader.ReadBool();
SpectateAllowed = reader.ReadBool();
KillPoints = version < 3 ? (reader.ReadBool() ? 1 : 0) : reader.ReadInt();
PointsBase = reader.ReadInt();
PointsRankFactor = reader.ReadDouble();
IdleKick = reader.ReadBool();
IdleThreshold = reader.ReadTimeSpan();
LastState = reader.ReadFlag<PvPBattleState>();
LastStateChange = reader.ReadDateTime();
LightLevel = reader.ReadInt();
LogoutDelay = reader.ReadTimeSpan();
Doors.AddRange(reader.ReadStrongItemList<BaseDoor>());
reader.ReadBlock(() => Options = reader.ReadTypeCreate<PvPBattleOptions>(reader) ?? new PvPBattleOptions());
if (Schedule != null && Schedule.Running)
{
Schedule.Stop();
}
reader.ReadBlock(
() => Schedule = reader.ReadTypeCreate<Schedule>(reader) ?? new Schedule("Battle " + Serial.Value, false));
reader.ReadBlock(
() => BattleRegion = reader.ReadTypeCreate<PvPBattleRegion>(this, reader) ?? new PvPBattleRegion(this));
reader.ReadBlock(
() => SpectateRegion = reader.ReadTypeCreate<PvPSpectateRegion>(this, reader) ?? new PvPSpectateRegion(this));
reader.ReadBlockList(() => reader.ReadTypeCreate<PvPTeam>(this, reader) ?? new PvPTeam(this), Teams);
}
break;
}
}
示例15: DeserializeProfiles
private static bool DeserializeProfiles(GenericReader reader)
{
int version = reader.GetVersion();
switch (version)
{
case 0:
{
reader.ReadBlockDictionary(
() =>
{
PlayerMobile key = reader.ReadMobile<PlayerMobile>();
PvPProfile val = reader.ReadTypeCreate<PvPProfile>(reader);
return new KeyValuePair<PlayerMobile, PvPProfile>(key, val);
},
Profiles);
}
break;
}
return true;
}