예제 #1
0
파일: Registro.cs 프로젝트: naaturaz/SM
 /// <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);
 }
예제 #2
0
파일: Registro.cs 프로젝트: Cdrix/SM
    /// <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);
    }