IsScriptNameAlreadyUsed() public method

public IsScriptNameAlreadyUsed ( string tryName, object ignoreObject ) : bool
tryName string
ignoreObject object
return bool
Example #1
0
 private static void EnsureCharacterScriptNameIsUnique(Character character, Game game)
 {
     string scriptNameBase = character.ScriptName;
     int suffix = 0;
     while (game.IsScriptNameAlreadyUsed(character.ScriptName, character))
     {
         suffix++;
         character.ScriptName = scriptNameBase + suffix;
     }
 }
Example #2
0
 private static void EnsureViewNameIsUnique(View view, Game game)
 {
     string scriptNameBase = view.Name;
     int suffix = 0;
     while (game.IsScriptNameAlreadyUsed(view.Name.ToUpper(), view))
     {
         suffix++;
         view.Name = scriptNameBase + suffix;
     }
 }
Example #3
0
 private static void AdjustScriptNamesToEnsureEverythingIsUnique(GUI gui, Game game)
 {
     while (game.IsScriptNameAlreadyUsed(gui.Name, gui))
     {
         gui.Name += "2";
     }
     foreach (GUIControl control in gui.Controls)
     {
         while (game.IsScriptNameAlreadyUsed(control.Name, control))
         {
             control.Name += "2";
         }
     }
 }