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


C# SpellEffect.SpellEffectHandlerCreator方法代码示例

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


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

示例1: CreateHandler

        private void CreateHandler(SpellEffect effect, int h, SpellEffectHandler[] handlers, ref SpellTargetCollection targets, ref SpellFailedReason failReason)
        {
            var handler = effect.SpellEffectHandlerCreator(this, effect);
            handlers[h] = handler;

            // make sure, we have the right Caster-Type
            handler.CheckCasterType(ref failReason);
            if (failReason != SpellFailedReason.Ok)
            {
                return;
            }

            // find targets and amount SpellTargetCollection if effects have same ImplicitTargetTypes
            if (InitialTargets != null)
            {
                // do we have given targets?
                if (targets == null)
                {
                    targets = CreateSpellTargetCollection();
                }
            }
            else if (handler.HasOwnTargets)
            {
                // see if targets are shared between effects
                targets = null;

                for (var j = 0; j < h; j++)
                {
                    var handler2 = handlers[j];
                    if (handler.Effect.SharesTargetsWith(handler2.Effect, IsAICast))
                    {
                        // same targets -> share target collection
                        targets = handler2.m_targets;
                        break;
                    }
                }

                if (targets == null)
                {
                    targets = CreateSpellTargetCollection();
                }
            }

            if (targets != null)
            {
                handler.m_targets = targets;
                targets.m_handlers.Add(handler);
            }
        }
开发者ID:ebakkedahl,项目名称:WCell,代码行数:49,代码来源:SpellCast.Perform.cs

示例2: CreateHandler

		private void CreateHandler(SpellEffect effect, int h, SpellEffectHandler[] handlers, ref SpellTargetCollection targets, ref SpellFailedReason failReason)
		{
			var handler = effect.SpellEffectHandlerCreator(this, effect);
			handlers[h] = handler;

			// make sure, we have the right Caster-Type
			handler.CheckCasterType(ref failReason);
			if (failReason != SpellFailedReason.Ok)
			{
				return;
			}

			// find targets and amount SpellTargetCollection if effects have same ImplicitTargetTypes
			if (m_initialTargets != null)
			{
				// do we have given targets?
				//targets = SpellTargetCollection.SpellTargetCollectionPool.Obtain();
				if (targets == null)
				{
					targets = new SpellTargetCollection();
				}
			}
			else if (handler.HasOwnTargets)
			{
				targets = null;

				// check if we have same target-types, else collect targets specifically for this Effect
				for (var j = 0; j < h; j++)
				{
					var handler2 = handlers[j];
					if (handler.Effect.TargetsEqual(handler2.Effect))
					{
						targets = handler2.m_targets;
						break;
					}
				}

				if (targets == null)
				{
					//targets = SpellTargetCollection.SpellTargetCollectionPool.Obtain();
					targets = new SpellTargetCollection();
				}
			}

			if (targets != null)
			{
				handler.m_targets = targets;
				targets.m_handlers.Add(handler);
			}
		}
开发者ID:enjoii,项目名称:WCell,代码行数:50,代码来源:SpellCast.Perform.cs


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