private void SaveStateToFile(string outputFilePath, World world) { var cellStates = world.ConvertCellsToCellState(); var input = new Input(world.Dimension, cellStates); var json = JsonConvert.SerializeObject(input, Formatting.Indented); File.WriteAllText(outputFilePath, json); }