/// <summary> /// Create a Back Process, which is used /// to leave a subgrid. /// </summary> /// <param name="previous"></param> /// <returns></returns> public static Process GenerateBack(IButtonable previous) { return(new Process( "Back", Util.GetSprite("plain-arrow"), string.Format("Go back to {0}.", previous.ButtonText), () => previous.Invoke() )); }
private static Process GetUnequipProcess(Page current, CastUnequipItem unequipSpell, Character owner, IButtonable previous, Action <IPlayable> handlePlayable) { return(new Process(unequipSpell.Name, unequipSpell.Icon, unequipSpell.CreateDescription(owner), () => { handlePlayable(owner.Spells.CreateSpell(current, unequipSpell, owner, owner)); previous.Invoke(); }, () => unequipSpell.IsCastable(owner, owner) )); }
private static Process GenerateTargetProcessHelper( Page current, IButtonable previous, Character owner, Character target, SpellBook sb, Action <IPlayable> handlePlayable, string name, Sprite icon) { return(new Process(name, icon, sb.CreateTargetDescription(owner, target), () => { if (sb.IsCastable(owner, target)) { handlePlayable(owner.Spells.CreateSpell(current, sb, owner, target)); previous.Invoke(); } })); }