public bool Check() { for (int i = 0; i < requiredConditions.Length; i++) { if (!AllConditions.CheckCondition(requiredConditions[i])) { return(false); } } return(true); }
public void SkipReaction() { for (int i = 0; i < requiredConditions.Length; i++) { if (!AllConditions.CheckCondition(requiredConditions[i])) { return; } } if (reactionCollection) { reactionCollection.Skip(); } }
public bool CheckAndReact() { if (requiredConditions.Any(rc => !AllConditions.CheckCondition(rc))) { return(false); } if (reactionCollection) { reactionCollection.React(); } return(true); }
public bool CheckAndReact() { for (int i = 0; i < requiredConditions.Length; i++) { if (!AllConditions.CheckCondition(requiredConditions[i])) { return(false); } } if (reactionCollection) { reactionCollection.React(); } return(true); }
public ReactionCollection reactionCollection; // reakcje do zrealizowania public bool CheckAndReact() // musimy teraz sprawdzic i jesli konieczne to zareagowac, defaultowo bedzie zwracac true { for (int i = 0; i < requiredConditions.Length; i++) // musimy sprawdzic wszystkie nasze kondycje w for loop, { if (!AllConditions.CheckCondition(requiredConditions[i])) { return(false); //chcemy sprawdzac tylko czy jakis warunek NIE jest spełniony } } if (reactionCollection) // jezeli wszystkie warunki zostaly spelnione to trzeba wyzwolic funkcje React { reactionCollection.React(); } return(true); }
public bool CheckAndReact() { for (int i = 0; i < requiredConditions.Length; i++) { if (!AllConditions.CheckCondition(requiredConditions[i])) //Checks if all the conditions are met, if they are not then it returns false { return(false); } } if (ReactionCollection) { ReactionCollection.React(); //if the conditions have been met and there are some reactions, then call them } return(true); }
/* * check the condition accroding to 3 different boolean value * if the the condition is checked return true; */ public bool CheckAndReact() { //check if the condition are satisfied for (int i = 0; i < requiredConditions.Length; i++) { if (!AllConditions.CheckCondition(requiredConditions[i])) { return(false); } } //if the condition collection is not completed than react if (reactionCollection && complete == false) { reactionCollection.React(); return(true); } return(false); }
// Check and React public bool CheckAndReact() { //Go through all Required Conditions for (int i = 0; i < requiredConditions.Length; i++) { // If the Condition is NOT met if (!AllConditions.CheckCondition(requiredConditions[i])) { //Return All Conditions met False return(true); } } //If the Condition IS met if (reactionCollection) { reactionCollection.React(); } // Condition Requirement is met return(true); }
public ReactionCollection reactionCollection; // Reference to the ReactionCollection that will React should all the Conditions be met. // This is called by the Interactable one at a time for each of its ConditionCollections until one returns true. public bool CheckAndReact() { // Go through all Conditions... for (int i = 0; i < requiredConditions.Length; i++) { // ... and check them against the AllConditions version of the Condition. If they don't have the same satisfied flag, return false. if (!AllConditions.CheckCondition(requiredConditions[i])) { return(false); } } // If there is an ReactionCollection assigned, call its React function. if (reactionCollection) { reactionCollection.React(); } // A Reaction happened so return true. return(true); }