當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。