/// <summary> /// If the key exist on Dict will add a Zero to the end of the MyId, will check again until it doesnt exist /// </summary> private General CheckIfOnDict <T>(Dictionary <string, T> onDictionary, General checkP) { if (onDictionary.ContainsKey(checkP.MyId)) { checkP.AddZeroToMyID(); //Recursive call so if still is contained will add a new zero until is not contained on the Dictiornay CheckIfOnDict(onDictionary, checkP); } return(checkP); }
/// <summary> /// If the key exist on Dict will add a Zero to the end of the MyId, will check again until it doesnt exist /// </summary> General CheckIfOnDict <T>(Dictionary <string, T> onDictionary, General checkP) { //is a CancelDemolish //if (checkP==null) //{ // checkP = SelectBuilding; //} if (onDictionary.ContainsKey(checkP.MyId)) { checkP.AddZeroToMyID(); //Recursive call so if still is contained will add a new zero until is not contained on the Dictiornay CheckIfOnDict(onDictionary, checkP); } return(checkP); }