Temp feature: Write deaths/restarts to text file

rabi_display
wcko87 8 years ago
parent 4928a82fb0
commit f448b6a460
  1. 10
      rabi_splitter_WPF/RabiRibiDisplay.cs

@ -106,6 +106,7 @@ namespace rabi_splitter_WPF
if (InGame())
{
inGameState.nRestarts++;
UpdateTextFile();
}
DebugLog("Reload Game! " + snapshot.playtime + " <- " + inGameState.lastNonZeroPlayTime);
}
@ -123,6 +124,7 @@ namespace rabi_splitter_WPF
if (InGame())
{
inGameState.nDeaths++;
UpdateTextFile();
}
DebugLog("Death!");
}
@ -197,6 +199,14 @@ namespace rabi_splitter_WPF
}
}
private void UpdateTextFile()
{
string text = $"Deaths: {inGameState.nDeaths}\nResets: {inGameState.nRestarts}";
System.IO.StreamWriter file = new System.IO.StreamWriter("deaths_restarts.txt");
file.WriteLine(text);
file.Close();
}
private void StartNewGame()
{
inGameState = new InGameState();

Loading…
Cancel
Save