private static void InitTilesets() { var id = 0; var done = false; while (!done) { id++; if (File.Exists(String.Format("{0}data files\\tilesets\\{1}.png", Data.AppPath, id))) { var texdata = new TexData(); texdata.File = String.Format("{0}data files\\tilesets\\{1}.png", Data.AppPath, id); Graphics.Tileset.Add(id, texdata); } else { done = true; } } }