public void SetFlag( SkillBallFlags flag, bool value ) { if ( value ) m_Flags |= flag; else m_Flags &= ~flag; }
public override void Deserialize(GenericReader reader) { base.Deserialize(reader); int version = reader.ReadEncodedInt(); switch (version) { case 1: { m_Flags = (SkillBallFlags)reader.ReadEncodedInt(); m_ExpireDate = reader.ReadDateTime(); goto case 0; } case 0: { m_SkillBonus = reader.ReadInt(); break; } } //We save it just in case, then delete it afterwards if (Expires && DateTime.UtcNow >= m_ExpireDate) { AddToCleanup(this); } }
public void SetFlag(SkillBallFlags flag, bool value) { if (value) { m_Flags |= flag; } else { m_Flags &= ~flag; } }
public bool GetFlag(SkillBallFlags flag) { return((m_Flags & flag) != 0); }
public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadEncodedInt(); switch ( version ) { case 1: { m_Flags = (SkillBallFlags)reader.ReadEncodedInt(); m_ExpireDate = reader.ReadDateTime(); goto case 0; } case 0: { m_SkillBonus = reader.ReadInt(); break; } } //We save it just in case, then delete it afterwards if ( Expires && DateTime.UtcNow >= m_ExpireDate ) AddToCleanup( this ); }
public bool GetFlag( SkillBallFlags flag ) { return ( m_Flags & flag ) != 0; }
public override void Deserialize( GenericReader reader ) { base.Deserialize( reader ); int version = reader.ReadInt(); /* if ( version == 0 ) //Donation Item { if ( reader.ReadBool() ) //Yes donation? ItemConversion.AddToDonationConversion( this ); version = reader.ReadInt(); //SkillBall } */ if ( version > 3 ) { switch ( version ) { case 4: { m_Flags = (SkillBallFlags)reader.ReadEncodedInt(); if ( AltMinCap ) m_MinCap = reader.ReadInt(); else m_MinCap = 120; if ( AltMaxCap ) m_MaxCap = reader.ReadInt(); else m_MaxCap = 100; if ( PlayerBound ) m_OwnerPlayer = reader.ReadMobile(); if ( AccountBound ) m_OwnerAccount = reader.ReadString(); m_ExpireDate = reader.ReadDateTime(); m_SkillBonus = reader.ReadInt(); break; } } //We save it just in case, then delete it afterwards if ( Expires && DateTime.Now > m_ExpireDate ) AddToCleanup( this ); } else //Conversion Code { m_OwnerAccount = reader.ReadString(); m_OwnerPlayer = reader.ReadMobile(); SetFlag( SkillBallFlags.Limited, !reader.ReadBool() ); m_SkillBonus = reader.ReadInt(); MaxCap = reader.ReadInt(); } }