public bool LoadPlayData(string filePath, WorldManager world) { string[] worldFiles = System.IO.Directory.GetFiles(filePath, "*." + PlayData.Extension); if (worldFiles.Length > 0) { PlayData = FileUtils.LoadJson <PlayData>(worldFiles[0], DwarfGame.COMPRESSED_BINARY_SAVES, world); } else { Console.Error.WriteLine("Can't load world from {0}, no data file found.", filePath); return(false); } return(true); }
public bool LoadPlayData(string filePath, WorldManager world) { // Todo: Use actual set path string[] worldFiles = Directory.GetFiles(filePath, "*." + PlayData.Extension); if (worldFiles.Length > 0) { PlayData = FileUtils.LoadJsonFromAbsolutePath <PlayData>(worldFiles[0], world); } else { Console.Error.WriteLine("Can't load world from {0}, no data file found.", filePath); return(false); } return(true); }