本文整理汇总了C#中Spell.castSpell方法的典型用法代码示例。如果您正苦于以下问题:C# Spell.castSpell方法的具体用法?C# Spell.castSpell怎么用?C# Spell.castSpell使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Spell
的用法示例。
在下文中一共展示了Spell.castSpell方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: addPosition
public Spell addPosition(WiimoteLib.Point pointF, DateTime dateTime)
{
if (spellNames.Count == 0 && !cloudBitWarningShown)
{
cloudBitWarningShown = true;
MessageBox.Show(
"You need to choose the spells and set the cloudBit configurations before casting spells",
"Configuration required",
MessageBoxButtons.OK,
MessageBoxIcon.Error);
return null;
}
if (spell == null)
{
addPosition(new Position(pointF, dateTime));
if (positions.Count > 10)
{
if (wandIsPaused(positions))
{
Spell chosen = brain.chooseSpell(positions);
if (chosen != null && authorization != null && device != null && spellNames != null)
{
for (int i = 0; i < spellNames.Count; i++)
{
if (spellNames[i].Equals(chosen.GetType().Name))
{
spell = chosen;
((CloudBitSpell)spell).setConfigurations(device, authorization, spellVoltages[i], spellDurations[i]);
spell.castSpell();
startSpell = DateTime.Now;
}
}
}
/*
strokes = decomposer.determineStrokes(positions);
// TODO: move to class for choosing which spell was cast
foreach (SpellTrigger trigger in spells)
{
if (trigger.triggered(strokes))
{
spell = trigger;
trigger.castSpell();
startSpell = DateTime.Now;
}
}
*/
}
}
}
else if (!spell.casting())
{
spell = null;
positions.Clear();
if (strokes != null)
{
strokes.Clear();
}
}
return spell;
}