本文整理汇总了C#中GenericReader.ReadTimeSpan方法的典型用法代码示例。如果您正苦于以下问题:C# GenericReader.ReadTimeSpan方法的具体用法?C# GenericReader.ReadTimeSpan怎么用?C# GenericReader.ReadTimeSpan使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GenericReader
的用法示例。
在下文中一共展示了GenericReader.ReadTimeSpan方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Deserialize
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
switch (version)
{
case 1:
{
reader.ReadItemList();
goto case 0;
}
case 0:
{
reader.ReadBool();
reader.ReadItemList();
reader.ReadItemList();
reader.ReadItemList();
reader.ReadItemList();
reader.ReadItemList();
reader.ReadTimeSpan();
reader.ReadInt();
break;
}
}
DeleteAll();
Delete();
}
示例2: Deserialize
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
switch (version)
{
case 1:
{
TimeSpan duration = reader.ReadTimeSpan();
m_Timer = new InternalTimer(this, duration);
m_Timer.Start();
m_End = DateTime.Now + duration;
break;
}
case 0:
{
TimeSpan duration = TimeSpan.FromSeconds(10.0);
m_Timer = new InternalTimer(this, duration);
m_Timer.Start();
m_End = DateTime.Now + duration;
break;
}
}
}
示例3: EnchantContext
public EnchantContext( GenericReader reader, BaseWeapon weapon )
{
m_Owner = reader.ReadMobile();
m_Attribute = (WeaponAttribute) reader.ReadInt();
m_SpellChanneling = reader.ReadBool();
m_Timer = Timer.DelayCall( reader.ReadTimeSpan(), new TimerStateCallback<BaseWeapon>( EnchantSpell.RemoveEnchantContext ), weapon );
weapon.EnchantContext = this;
}
示例4: Deserialize
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.GetVersion();
switch (version)
{
case 0:
AccountAge = reader.ReadTimeSpan();
break;
}
}
示例5: DuelInfo
public DuelInfo(GenericReader reader)
{
int version = reader.ReadEncodedInt();
switch (version)
{
case 0:
{
m_DuelTime = reader.ReadTimeSpan();
m_AgainstList = reader.ReadStrongMobileList();
break;
}
}
}
示例6: Deserialize
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
switch (version)
{
case 0:
m_MemberShipTime = TimeSpan.Zero;
break;
case 1:
m_MemberShipTime = reader.ReadTimeSpan();
break;
default:
m_MemberShipTime = TimeSpan.Zero;
break;
}
}
示例7: Deserialize
public override void Deserialize(GenericReader reader)
{
base.Deserialize( reader );
int version = reader.ReadInt();
switch ( version )
{
case 0:
{
int count = reader.ReadInt();
for ( int i = 0; i < count; ++i )
{
Mobile m = reader.ReadMobile();
DisguiseTimers.CreateTimer( m, reader.ReadTimeSpan() );
m.NameMod = reader.ReadString();
}
break;
}
}
}
示例8: Deserialize
//.........这里部分代码省略.........
m_ColdResistance = reader.ReadInt();
m_ColdDamage = reader.ReadInt();
m_PoisonResistance = reader.ReadInt();
m_PoisonDamage = reader.ReadInt();
m_EnergyResistance = reader.ReadInt();
m_EnergyDamage = reader.ReadInt();
}
if ( version >= 8 )
m_Owners = reader.ReadStrongMobileList();
else
m_Owners = new List<Mobile>();
if ( version >= 10 )
{
m_IsDeadPet = reader.ReadBool();
m_IsBonded = reader.ReadBool();
m_BondingBegin = reader.ReadDateTime();
m_OwnerAbandonTime = reader.ReadDateTime();
}
if ( version >= 11 )
m_HasGeneratedLoot = reader.ReadBool();
else
m_HasGeneratedLoot = true;
if ( version >= 12 )
m_Paragon = reader.ReadBool();
else
m_Paragon = false;
if ( version >= 13 && reader.ReadBool() )
m_Friends = reader.ReadStrongMobileList();
else if ( version < 13 && m_ControlOrder >= OrderType.Unfriend )
++m_ControlOrder;
if ( version < 16 && Loyalty != MaxLoyalty )
Loyalty *= 10;
double activeSpeed = m_dActiveSpeed;
double passiveSpeed = m_dPassiveSpeed;
SpeedInfo.GetSpeeds( this, ref activeSpeed, ref passiveSpeed );
bool isStandardActive = false;
for ( int i = 0; !isStandardActive && i < m_StandardActiveSpeeds.Length; ++i )
isStandardActive = ( m_dActiveSpeed == m_StandardActiveSpeeds[i] );
bool isStandardPassive = false;
for ( int i = 0; !isStandardPassive && i < m_StandardPassiveSpeeds.Length; ++i )
isStandardPassive = ( m_dPassiveSpeed == m_StandardPassiveSpeeds[i] );
if ( isStandardActive && m_dCurrentSpeed == m_dActiveSpeed )
m_dCurrentSpeed = activeSpeed;
else if ( isStandardPassive && m_dCurrentSpeed == m_dPassiveSpeed )
m_dCurrentSpeed = passiveSpeed;
if ( isStandardActive && !m_Paragon )
m_dActiveSpeed = activeSpeed;
if ( isStandardPassive && !m_Paragon )
m_dPassiveSpeed = passiveSpeed;
if ( version >= 14 )
{
m_RemoveIfUntamed = reader.ReadBool();
m_RemoveStep = reader.ReadInt();
}
TimeSpan deleteTime = TimeSpan.Zero;
if ( version >= 17 )
deleteTime = reader.ReadTimeSpan();
if ( deleteTime > TimeSpan.Zero || LastOwner != null && !Controlled && !IsStabled )
{
if ( deleteTime == TimeSpan.Zero )
deleteTime = TimeSpan.FromDays( 3.0 );
m_DeleteTimer = new DeleteTimer( this, deleteTime );
m_DeleteTimer.Start();
}
if( version <= 14 && m_Paragon && Hue == 0x31 )
{
Hue = Paragon.Hue; //Paragon hue fixed, should now be 0x501.
}
CheckStatTimers();
ChangeAIType(m_CurrentAI);
AddFollowers();
if ( IsAnimatedDead )
Spells.Necromancy.AnimateDeadSpell.Register( m_SummonMaster, this );
}
示例9: Deserialize
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
switch ( version )
{
case 0:
{
this.m_BurntOut = reader.ReadBool();
this.m_Burning = reader.ReadBool();
this.m_Duration = reader.ReadTimeSpan();
this.m_Protected = reader.ReadBool();
if (this.m_Burning && this.m_Duration != TimeSpan.Zero)
this.DoTimer(reader.ReadDeltaTime() - DateTime.Now);
break;
}
}
}
示例10: Deserialize
public virtual void Deserialize(GenericReader reader)
{
int version = reader.ReadInt();
SaveFlag flags = SaveFlag.None;
if (version >= 4)
{
flags = (SaveFlag)reader.ReadInt();
}
switch (version)
{
case 4:
if (GetSaveFlag(flags, SaveFlag.ExpireActCondition))
{
m_ExpireActCondition = reader.ReadString();
}
if (GetSaveFlag(flags, SaveFlag.ExpireAction))
{
m_ExpireAction = reader.ReadString();
}
if (GetSaveFlag(flags, SaveFlag.ExpireTrigMob))
{
m_ExpireTrigMob = reader.ReadMobile();
}
if (GetSaveFlag(flags, SaveFlag.AttachedBy))
{
m_AttachedBy = reader.ReadString();
}
if (GetSaveFlag(flags, SaveFlag.OwnedByMobile))
{
OwnedBy = reader.ReadMobile();
}
else if (GetSaveFlag(flags, SaveFlag.OwnedByItem))
{
OwnedBy = reader.ReadItem();
}
if (GetSaveFlag(flags, SaveFlag.Name))
{
Name = reader.ReadString();
}
// if there are any active timers, then serialize
if (GetSaveFlag(flags, SaveFlag.Expiration))
{
m_Expiration = reader.ReadTimeSpan();
}
if (GetSaveFlag(flags, SaveFlag.ExpirationEnd))
{
TimeSpan remainingTime = reader.ReadTimeSpan();
if (remainingTime > TimeSpan.Zero)
{
DoTimer(remainingTime);
}
}
if (GetSaveFlag(flags, SaveFlag.CreationTime))
{
m_CreationTime = reader.ReadDateTime();
}
// DO NOT GO ON TO CASE 3 OR BELOW!
break;
// =============== OLD DESERIALIZATION =====================
case 3:
m_ExpireAction = reader.ReadString();
m_ExpireActCondition = reader.ReadString();
m_ExpireTrigMob = reader.ReadMobile();
goto case 2;
case 2:
m_AttachedBy = reader.ReadString();
goto case 1;
case 1:
int owned = reader.ReadInt();
if (owned == 0)
{
OwnedBy = reader.ReadItem();
}
else if (owned == 1)
{
OwnedBy = reader.ReadMobile();
}
else
{
OwnedBy = null;
}
goto case 0;
case 0:
// version 0
Name = reader.ReadString();
m_Expiration = reader.ReadTimeSpan();
TimeSpan remaining = reader.ReadTimeSpan();
if (remaining > TimeSpan.Zero)
{
DoTimer(remaining);
}
m_CreationTime = reader.ReadDateTime();
break;
}
//.........这里部分代码省略.........
示例11: Deserialize
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
// version 0
m_Word = reader.ReadString();
m_Skill = (SkillName) reader.ReadInt();
m_Value = reader.ReadInt();
m_Duration = reader.ReadTimeSpan();
m_RequireIdentification = reader.ReadBool();
m_Identified = reader.ReadBool();
}
示例12: Deserialize
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
switch (version)
{
case 3:
this.m_MaxTargetRange = reader.ReadInt();
goto case 2;
case 2:
this.m_TargetingEnabled = reader.ReadBool();
this.m_TargetingAction = reader.ReadString();
this.m_TargetCondition = reader.ReadString();
this.m_TargetFailureAction = reader.ReadString();
this.m_TargetFailureReward = reader.ReadString();
goto case 1;
case 1:
this.m_AllowCarried = reader.ReadBool();
goto case 0;
case 0:
// version 0
this.m_RequireLOS = reader.ReadBool();
this.m_MaxRange = reader.ReadInt();
this.Refractory = reader.ReadTimeSpan();
TimeSpan remaining = reader.ReadTimeSpan();
this.m_EndTime = DateTime.UtcNow + remaining;
this.m_MaxUses = reader.ReadInt();
this.m_NUses = reader.ReadInt();
this.m_BlockDefaultUse = reader.ReadBool();
this.m_Condition = reader.ReadString();
this.m_SuccessAction = reader.ReadString();
this.m_SuccessReward = reader.ReadString();
this.m_FailureAction = reader.ReadString();
this.m_FailureReward = reader.ReadString();
this.m_RefractoryAction = reader.ReadString();
this.m_RefractoryReward = reader.ReadString();
this.m_MaxUsesAction = reader.ReadString();
this.m_MaxUsesReward = reader.ReadString();
break;
}
}
示例13: Deserialize
public override void Deserialize(GenericReader reader)
{
base.Deserialize(reader);
int version = reader.ReadInt();
if (version >= 0)
{
this.m_SpawnRange = reader.ReadInt();
this.m_NextSpawnDelay = reader.ReadTimeSpan();
}
this.m_NextSpawn = DateTime.Now;
}
示例14: Deserialize
public virtual void Deserialize(GenericReader reader)
{
int version = reader.ReadInt();
switch (version)
{
case 2:
this.m_AttachedBy = reader.ReadString();
goto case 1;
case 1:
int owned = reader.ReadInt();
if (owned == 0)
{
this.OwnedBy = reader.ReadItem();
}
else if (owned == 1)
{
this.OwnedBy = reader.ReadMobile();
}
else
this.OwnedBy = null;
goto case 0;
case 0:
// version 0
this.Name = (string)reader.ReadString();
this.m_Expiration = reader.ReadTimeSpan();
TimeSpan remaining = (TimeSpan)reader.ReadTimeSpan();
if (remaining > TimeSpan.Zero)
this.DoTimer(remaining);
this.m_CreationTime = reader.ReadDateTime();
break;
}
}
示例15: Deserialize
public override void Deserialize( GenericReader reader )
{
base.Deserialize( reader );
int version = reader.ReadInt();
switch ( version )
{
case 0:
{
m_EffectDelay = reader.ReadTimeSpan();
m_TriggerDelay = reader.ReadTimeSpan();
m_SoundDelay = reader.ReadTimeSpan();
m_Source = ReadEntity( reader );
m_Target = ReadEntity( reader );
m_Trigger = reader.ReadItem() as EffectController;
m_FixedDirection = reader.ReadBool();
m_Explodes = reader.ReadBool();
m_PlaySoundAtTrigger = reader.ReadBool();
m_EffectType = (EffectType)reader.ReadEncodedInt();
m_EffectLayer = (EffectLayer)reader.ReadEncodedInt();
m_TriggerType = (EffectTriggerType)reader.ReadEncodedInt();
m_ItemID = reader.ReadEncodedInt();
m_Hue = reader.ReadEncodedInt();
m_RenderMode = reader.ReadEncodedInt();
m_Speed = reader.ReadEncodedInt();
m_Duration = reader.ReadEncodedInt();
m_ParticleEffect = reader.ReadEncodedInt();
m_ExplodeParticleEffect = reader.ReadEncodedInt();
m_ExplodeSound = reader.ReadEncodedInt();
m_Unknown = reader.ReadEncodedInt();
m_SoundID = reader.ReadEncodedInt();
m_TriggerRange = reader.ReadEncodedInt();
break;
}
}
}