public void TriggerEvent(EventTriggerEnum requestTrigger, IAttackCard card, IBattelBase battel, Action finish) { this.finish = finish; if (isReady == false || triggers.Contains(requestTrigger) == false || conditionsAbility.IsConditions(card, battel) == false) { finish?.Invoke(); } else { Finish(card, effectAbility.IsResult(card, battel, specificityFactory)); } }
/// <summary> /// 获取前置条件 /// </summary> /// <returns></returns> public static List <EventTriggerBean> GetListTriggerData(string data) { List <EventTriggerBean> listTriggerData = new List <EventTriggerBean>(); List <string> listData = StringUtil.SplitBySubstringForListStr(data, '|'); foreach (string itemData in listData) { if (CheckUtil.StringIsNull(itemData)) { continue; } List <string> itemListData = StringUtil.SplitBySubstringForListStr(itemData, ':'); EventTriggerEnum triggerType = EnumUtil.GetEnum <EventTriggerEnum>(itemListData[0]); string triggerValue = itemListData[1]; listTriggerData.Add(new EventTriggerBean(triggerType, triggerValue)); } return(listTriggerData); }
private void ApplyAbility(EventTriggerEnum eventTrigger, IAttackCard current, Action nextAct) => current.ExecuteAbility(eventTrigger, battel, () => CheckForDeath(nextAct));
public EventTriggerBean(EventTriggerEnum triggerType, string triggerData) { this.triggerType = triggerType; this.triggerData = triggerData; }
private void updateEventState(EventTriggerEnum e, bool used) { int num = (int)e - (int)EventTriggerEnum.EV_PLAYER_TALK_TO_ME; this.eventsList.Items[num].ForeColor = (used ? Color.Black : Color.Gray); }
// Карта совершает анимацию и показывает специфект способности public void ExecuteAbility(EventTriggerEnum trigger, IBattelBase battel, Action finish) { View.Frame(true); Ability.TriggerEvent(trigger, this, battel, () => { View.Frame(false); finish?.Invoke(); }); }