// function for checking if objects can be combined together public void CheckCombine(PickIntObj objA, PickIntObj objB) { if (objA != null) { objA.Click(); } if (objB != null) { objB.Click(); } InteractiveObject temp = null; for (int i = 0; i < relationList.Count; i++) { if (relationList [i].Key == objA) { temp = relationList [i].Value; break; } } for (int i = 0; i < relationList.Count; i++) { if (relationList [i].Value == temp && relationList [i].Key == objB) { temp.Click(); return; } } objA.Choose(); objB.Choose(); }
// function for checking if the condition(s) of an obj is fulfilled public void GetLink(InteractiveObject intObj, PickIntObj selectedIntObj) { if (intObj == null) { selectedIntObj.Choose(); return; } if (selectedIntObj != null) { selectedIntObj.Click(); } bool related = false; for (int i = 0; i < relationList.Count; i++) { if (relationList [i].Value == intObj) { if (relationList [i].Key == selectedIntObj) { related = true; } if (!relationList[i].Key.IsSolved()) { if (selectedIntObj != null) { selectedIntObj.Choose(); } return; } } } if (!related && selectedIntObj != null) { selectedIntObj.Choose(); return; } intObj.Click(); }