public void Save() { if (Utility.FileExists("config", planetInfo.planetName, "userplanet")) { //dialog or something print("planet already exists"); } else { StreamWriter writer = Utility.GetConfigFileWriter("config", planetInfo.planetName, "userplanet"); writer.Write(planetInfo.ToString()); writer.Close(); } }