public static String GenerateName( World world )
{
if ( world.Map.MessageBlocks != null ) {
if ( world.Map.MessageBlocks.Count > 0 ) {
bool found = false;
while ( !found ) {
bool taken = false;
foreach ( MessageBlock MessageBlock in world.Map.MessageBlocks ) {
if ( MessageBlock.Name.Equals( "MB" + world.Map.MessageBlockID ) ) {
taken = true;
break;
}
}
if ( !taken ) {
found = true;
} else {
world.Map.MessageBlockID++;
}
}
return "MB" + world.Map.MessageBlockID;
}
}
return "MB1";
}