本文整理匯總了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);
}
}
示例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);
}
}