Beispiel #1
0
 /// <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);
 }
Beispiel #2
0
    /// <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);
    }