/// <summary> /// Sets the activation condition expression for the build complex gateway /// </summary> /// <param name="conditionExpression"> the activation condition expression to set </param> /// <returns> the builder object </returns> public virtual B activationCondition(string conditionExpression) { ActivationCondition activationCondition = createInstance(typeof(ActivationCondition)); activationCondition.TextContent = conditionExpression; element.ActivationCondition = activationCondition; return(myself); }
public static IActivationCondition CompileFilterCondition(FilterElement element, IEnumerable <Declaration> declarations) { var optimizer = new ExpressionMultiParameterOptimizer <Func <object[], bool> >(); var optimizedExpression = optimizer.CompactParameters(element.Expression, 0); var @delegate = optimizedExpression.Compile(); var fastDelegate = Create(@delegate, element.Expression.Parameters.Count); var factMap = IndexMap.CreateMap(element.Imports, declarations); var expression = new ActivationCondition(element.Expression, fastDelegate, factMap); return(expression); }
static public int CheckActivationCondition(ActivationCondition actCon) { int res = -1; if (actCon.ActivationMethodName == "מתוזמנת") { if (actCon.DistanceOrTimeParam == DateTime.Now.ToShortTimeString()) { res = ChangeDeviceStatus(actCon.CreatedByUserId, actCon.DeviceId, actCon.RoomId, actCon.TurnOn, 2, actCon.ActivationParam.ToString(), actCon.ConditionId.ToString()); } } return(res); }
//Проверить условия для появления варианта диалога bool CheckDialogOptionConditions(int optionNum) { bool isActive = true; for (int i = 0; i < nodes[currentNode].options[optionNum].conditions.Length; i++) { ActivationCondition currentCondition = nodes[currentNode].options[optionNum].conditions[i].condition; bool bValue; switch (currentCondition) { case ActivationCondition.QUEST_IS_ACTIVE: bValue = Managers.questMgr.QuestIsActive(nodes[currentNode].options[optionNum].conditions[i].questID); isActive = isActive & bValue; break; case ActivationCondition.HAVE_AN_ITEM: bValue = Managers.inventory.HaveAnItem(nodes[currentNode].options[optionNum].conditions[i].requiredItem); isActive = isActive & bValue; break; case ActivationCondition.NPC_IS_DEAD: bValue = false; NPC_Manager npc = nodes[currentNode].options[optionNum].conditions[i].npc; if (npc != null) { bValue = npc.IsDead(); } isActive = isActive & bValue; break; case ActivationCondition.QUEST_IS_COMPLETED: bValue = Managers.questMgr.QuestIsComleted(nodes[currentNode].options[optionNum].conditions[i].questID); isActive = isActive & bValue; break; } } return(isActive); }
static public JsonData GetActivationConditionDetails(ActivationCondition actCon) { return(DBService.GetActivationConditionDetails(actCon)); }
protected abstract void Process(StatusEffectInstance effect, ActivationCondition condition);
public abstract bool IsValidCondition(ActivationCondition condition);
bool CheckCondition(ActivationCondition condition) { return(conditions.Contains(condition)); }