// untested, returns true, if problem already exists bool CheckNewProblemDupe(LFAI.TMProbType newType, LFAI.Formation formation) { bool dupe = false; foreach (LFAI.TMProblem problem in newProblems) { if (problem.problemFormation == formation && problem.ProbType == newType) { dupe = true; } } return(dupe); }
// untested, returns true, if problem already exists in either new problems or ones being solved bool CheckProblemDupe(LFAI.TMProbType newType, LFAI.Formation formation) { foreach (LFAI.TMProblem problem in newProblems) { if (problem.problemFormation == formation && problem.ProbType == newType) { return(true); } } foreach (LFAI.TMProblem problem in problemsBeingSolved) { if (problem.problemFormation == formation && problem.ProbType == newType) { return(true); } } return(false); }
public TMProblem(TMProbType probType, float priority, float solutionValue, LFAI.Formation probFormation) { ProbType = probType; ProbPriority = priority; problemFormation = probFormation; solutionParameter = solutionValue; timeOfDeclaration = Time.timeSinceLevelLoad; }