当前位置: 首页>>代码示例>>C#>>正文


C# GenericReader.ReadDeltaTime方法代码示例

本文整理汇总了C#中GenericReader.ReadDeltaTime方法的典型用法代码示例。如果您正苦于以下问题:C# GenericReader.ReadDeltaTime方法的具体用法?C# GenericReader.ReadDeltaTime怎么用?C# GenericReader.ReadDeltaTime使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在GenericReader的用法示例。


在下文中一共展示了GenericReader.ReadDeltaTime方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Deserialize

        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize( reader );
              		int version = reader.ReadInt();

            switch ( version )
            {
                case 1:
                {
                    m_End = reader.ReadDeltaTime();
                    m_EvolutionTimer = new EvolutionTimer( this, m_End - DateTime.Now );
                    m_EvolutionTimer.Start();

                    break;
                }
                case 0:
                {
                    TimeSpan duration = TimeSpan.FromDays( 1.0 );

                    m_EvolutionTimer = new EvolutionTimer( this, duration );
                    m_EvolutionTimer.Start();
                    m_End = DateTime.Now + duration;

                    break;
                }
            }
        }
开发者ID:greeduomacro,项目名称:DimensionsNewAge,代码行数:27,代码来源:Korpre+Egg.cs

示例2: VendorInventory

        public VendorInventory(BaseHouse house, GenericReader reader)
        {
            this.m_House = house;

            int version = reader.ReadEncodedInt();

            this.m_Owner = reader.ReadMobile();
            this.m_VendorName = reader.ReadString();
            this.m_ShopName = reader.ReadString();

            this.m_Items = reader.ReadStrongItemList();
            this.m_Gold = reader.ReadInt();

            this.m_ExpireTime = reader.ReadDeltaTime();

            if (this.m_Items.Count == 0 && this.m_Gold == 0)
            {
                Timer.DelayCall(TimeSpan.Zero, new TimerCallback(Delete));
            }
            else
            {
                TimeSpan delay = this.m_ExpireTime - DateTime.Now;
                this.m_ExpireTimer = new ExpireTimer(this, delay > TimeSpan.Zero ? delay : TimeSpan.Zero);
                this.m_ExpireTimer.Start();
            }
        }
开发者ID:FreeReign,项目名称:forkuo,代码行数:26,代码来源:VendorInventory.cs

示例3: Deserialize

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);
            int version = reader.ReadInt();

            m_DecayTime = reader.ReadDeltaTime();
            m_Timer = new InternalTimer(this, m_DecayTime);
            m_Timer.Start();

        }
开发者ID:greeduomacro,项目名称:cov-shard-svn-1,代码行数:10,代码来源:SCMMarker.cs

示例4: Deserialize

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch ( version )
            {
                case 0:
                    {
                        this.m_End = reader.ReadDeltaTime();

                        this.m_Timer = new InternalTimer(this, this.m_End - DateTime.UtcNow);
                        this.m_Timer.Start();

                        break;
                    }
            }
        }
开发者ID:Crylian,项目名称:ServUO,代码行数:19,代码来源:NavreyParalyzingWeb.cs

示例5: Deserialize

		public override void Deserialize(GenericReader reader)
		{
			base.Deserialize(reader);

			int version = reader.ReadInt();

			switch (version)
			{
				case 0:
					{
						_Decays = reader.ReadBool();

						if (_Decays)
						{
							_DecayTime = reader.ReadDeltaTime();

							_Timer = new InternalTimer(this, _DecayTime);
							_Timer.Start();
						}
					}
					break;
			}
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:23,代码来源:StarRoomGate.cs

示例6: PlantSystem

        public PlantSystem(PlantItem plant, GenericReader reader)
        {
            this.m_Plant = plant;

            int version = reader.ReadInt();

            this.m_FertileDirt = reader.ReadBool();

            if (version >= 1)
                this.m_NextGrowth = reader.ReadDateTime();
            else
                this.m_NextGrowth = reader.ReadDeltaTime();

            this.m_GrowthIndicator = (PlantGrowthIndicator)reader.ReadInt();

            this.m_Water = reader.ReadInt();

            this.m_Hits = reader.ReadInt();
            this.m_Infestation = reader.ReadInt();
            this.m_Fungus = reader.ReadInt();
            this.m_Poison = reader.ReadInt();
            this.m_Disease = reader.ReadInt();
            this.m_PoisonPotion = reader.ReadInt();
            this.m_CurePotion = reader.ReadInt();
            this.m_HealPotion = reader.ReadInt();
            this.m_StrengthPotion = reader.ReadInt();

            this.m_Pollinated = reader.ReadBool();
            this.m_SeedType = (PlantType)reader.ReadInt();
            this.m_SeedHue = (PlantHue)reader.ReadInt();
            this.m_AvailableSeeds = reader.ReadInt();
            this.m_LeftSeeds = reader.ReadInt();

            this.m_AvailableResources = reader.ReadInt();
            this.m_LeftResources = reader.ReadInt();
        }
开发者ID:m309,项目名称:ForkUO,代码行数:36,代码来源:PlantSystem.cs

示例7: Deserialize

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch ( version )
            {
                case 1:
                    {
                        this.NextWoolTime = reader.ReadDeltaTime();
                        break;
                    }
            }
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:15,代码来源:Kepetch.cs

示例8: Deserialize

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch ( version )
            {
                case 12:
                    {
                        if (reader.ReadBool())
                            this.m_RestoreEquip = reader.ReadStrongItemList();

                        goto case 11;
                    }
                case 11:
                    {
                        // Version 11, we move all bools to a CorpseFlag
                        this.m_Flags = (CorpseFlag)reader.ReadInt();

                        this.m_TimeOfDeath = reader.ReadDeltaTime();

                        int count = reader.ReadInt();

                        for (int i = 0; i < count; ++i)
                        {
                            Item item = reader.ReadItem();

                            if (reader.ReadBool())
                                this.SetRestoreInfo(item, reader.ReadPoint3D());
                            else if (item != null)
                                this.SetRestoreInfo(item, item.Location);
                        }

                        if (reader.ReadBool())
                            this.BeginDecay(reader.ReadDeltaTime() - DateTime.Now);

                        this.m_Looters = reader.ReadStrongMobileList();
                        this.m_Killer = reader.ReadMobile();

                        this.m_Aggressors = reader.ReadStrongMobileList();
                        this.m_Owner = reader.ReadMobile();

                        this.m_CorpseName = reader.ReadString();

                        this.m_AccessLevel = (AccessLevel)reader.ReadInt();
                        reader.ReadInt(); // guild reserve
                        this.m_Kills = reader.ReadInt();

                        this.m_EquipItems = reader.ReadStrongItemList();
                        break;
                    }
                case 10:
                    {
                        this.m_TimeOfDeath = reader.ReadDeltaTime();

                        goto case 9;
                    }
                case 9:
                    {
                        int count = reader.ReadInt();

                        for (int i = 0; i < count; ++i)
                        {
                            Item item = reader.ReadItem();

                            if (reader.ReadBool())
                                this.SetRestoreInfo(item, reader.ReadPoint3D());
                            else if (item != null)
                                this.SetRestoreInfo(item, item.Location);
                        }

                        goto case 8;
                    }
                case 8:
                    {
                        this.SetFlag(CorpseFlag.VisitedByTaxidermist, reader.ReadBool());

                        goto case 7;
                    }
                case 7:
                    {
                        if (reader.ReadBool())
                            this.BeginDecay(reader.ReadDeltaTime() - DateTime.Now);

                        goto case 6;
                    }
                case 6:
                    {
                        this.m_Looters = reader.ReadStrongMobileList();
                        this.m_Killer = reader.ReadMobile();

                        goto case 5;
                    }
                case 5:
                    {
                        this.SetFlag(CorpseFlag.Carved, reader.ReadBool());

                        goto case 4;
                    }
//.........这里部分代码省略.........
开发者ID:Drilikath,项目名称:ForkUO,代码行数:101,代码来源:Corpse.cs

示例9: Deserialize

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            if (reader.ReadBool())
                this.m_DestinationString = reader.ReadString(); // NOTE: We cannot EDI.Find here, regions have not yet been loaded :-(

            if (reader.ReadBool())
            {
                this.m_DeleteTime = reader.ReadDeltaTime();
                this.m_DeleteTimer = new DeleteTimer(this, this.m_DeleteTime - DateTime.UtcNow);
                this.m_DeleteTimer.Start();
            }
        }
开发者ID:jasegiffin,项目名称:JustUO,代码行数:16,代码来源:TalkingBaseEscortable.cs

示例10: Deserialize

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch ( version )
            {
                case 2:
                    {
                        if (reader.ReadBool())
                        {
                            this.m_DecayTime = reader.ReadDeltaTime();
                            this.BeginDecay(this.m_DecayTime - DateTime.UtcNow);
                        }
                        break;
                    }
                case 1:
                case 0:
                    {
                        if (this.Parent == null)
                            this.BeginDecay(m_DefaultDecayTime);
                        break;
                    }
            }

            if (version < 1 && this.Hue == 0)
                this.Hue = 2301;
        }
开发者ID:Ziden,项目名称:ServUO-EC-Test-Fork,代码行数:29,代码来源:OuterTorso.cs

示例11: Deserialize

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch ( version )
            {
                case 1:
                {
                    m_AllowMating = reader.ReadBool();
                    m_HasEgg = reader.ReadBool();
                    m_Pregnant = reader.ReadBool();
                    m_S1 = reader.ReadBool();
                    m_S2 = reader.ReadBool();
                    m_KPKorpre3 = reader.ReadInt();
                    m_Stage = reader.ReadInt();
                    m_EndMating = reader.ReadDeltaTime();
                    m_Korpre3MatingTimer = new Korpre3MatingTimer( this, m_EndMating - DateTime.Now );
                    m_Korpre3MatingTimer.Start();

                    break;
                }
                case 0:
                {
                    TimeSpan durationmating = TimeSpan.FromDays( 0.0 );

                    m_Korpre3MatingTimer = new Korpre3MatingTimer( this, durationmating );
                    m_Korpre3MatingTimer.Start();
                    m_EndMating = DateTime.Now + durationmating;

                    break;
                }
            }
        }
开发者ID:greeduomacro,项目名称:DimensionsNewAge,代码行数:35,代码来源:Evolution+Korpre+3.cs

示例12: Deserialize

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadEncodedInt();

            switch( version )
            {
                case 1:
                    {
                        this.m_Content = FillableContent.Lookup((FillableContentType)reader.ReadInt());
                        goto case 0;
                    }
                case 0:
                    {
                        if (reader.ReadBool())
                        {
                            this.m_NextRespawnTime = reader.ReadDeltaTime();

                            TimeSpan delay = this.m_NextRespawnTime - DateTime.UtcNow;
                            this.m_RespawnTimer = Timer.DelayCall(delay > TimeSpan.Zero ? delay : TimeSpan.Zero, new TimerCallback(Respawn));
                        }
                        else
                        {
                            this.CheckRespawn();
                        }

                        break;
                    }
            }
        }
开发者ID:Ziden,项目名称:ServUO-EC-Test-Fork,代码行数:31,代码来源:FillableContainers.cs

示例13: 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;
                    }
            }
        }
开发者ID:m309,项目名称:ForkUO,代码行数:22,代码来源:BaseLight.cs

示例14: Deserialize


//.........这里部分代码省略.........
                    for ( i = 0; i < iCount; i++ )
                        reader.ReadString();

                    iCount = reader.ReadInt();
                    for ( i = 0; i < iCount; i++ )
                        reader.ReadString();
                }
            }
            else
            {
                m_iRangeHome = 0;
            }

            if ( version >= 2 )
            {
                m_FightMode = (FightMode) reader.ReadInt();

                m_bControlled = reader.ReadBool();
                m_ControlMaster = reader.ReadMobile();
                m_ControlTarget = reader.ReadMobile();
                m_ControlDest = reader.ReadPoint3D();
                m_ControlOrder = (OrderType) reader.ReadInt();

                m_dMinTameSkill = reader.ReadDouble();

                if ( version < 9 )
                    reader.ReadDouble();

                m_bTamable = reader.ReadBool();
                m_bSummoned = reader.ReadBool();

                if ( m_bSummoned )
                {
                    m_SummonEnd = reader.ReadDeltaTime();
                    new UnsummonTimer( m_ControlMaster, this, m_SummonEnd - DateTime.Now ).Start();
                }

                m_iControlSlots = reader.ReadInt();
            }
            else
            {
                m_FightMode = FightMode.Closest;

                m_bControlled = false;
                m_ControlMaster = null;
                m_ControlTarget = null;
                m_ControlOrder = OrderType.None;
            }

            if ( version >= 3 )
                m_Loyalty = (PetLoyalty) reader.ReadInt();
            else
                m_Loyalty = PetLoyalty.WonderfullyHappy;

            if ( version >= 4 )
                m_CurrentWayPoint = reader.ReadItem() as WayPoint;

            if ( version >= 5 )
                m_SummonMaster = reader.ReadMobile();

            if ( version >= 6 )
            {
                m_HitsMax = reader.ReadInt();
                m_StamMax = reader.ReadInt();
                m_ManaMax = reader.ReadInt();
                m_DamageMin = reader.ReadInt();
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:67,代码来源:BaseCreature.cs

示例15: Deserialize

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadEncodedInt();

            this.m_Artifacts = new StealableInstance[m_Entries.Length];
            this.m_Table = new Hashtable(m_Entries.Length);

            int length = reader.ReadEncodedInt();

            for (int i = 0; i < length; i++)
            {
                Item item = reader.ReadItem();
                DateTime nextRespawn = reader.ReadDeltaTime();

                if (i < this.m_Artifacts.Length)
                {
                    StealableInstance si = new StealableInstance(m_Entries[i], item, nextRespawn);
                    this.m_Artifacts[i] = si;

                    if (si.Item != null)
                        this.m_Table[si.Item] = si;
                }
            }

            for (int i = length; i < m_Entries.Length; i++)
            {
                this.m_Artifacts[i] = new StealableInstance(m_Entries[i]);
            }

            this.m_RespawnTimer = Timer.DelayCall(TimeSpan.Zero, TimeSpan.FromMinutes(15.0), new TimerCallback(CheckRespawn));
        }
开发者ID:Ziden,项目名称:ServUO-EC-Test-Fork,代码行数:33,代码来源:StealableArtifactsSpawner.cs


注:本文中的GenericReader.ReadDeltaTime方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。