VEndymionV

Untitled

Sep 9th, 2018
89
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.53 KB | None | 0 0
  1. #pragma region Odczyt_najlepszego_czasu
  2. std::fstream file;
  3. file.open("scores.txt", std::ios::in);
  4. // Plik nie jest pusty
  5. if (file.good() && file.peek() != std::ifstream::traits_type::eof()) {
  6. file >> bestTime;
  7. }
  8. else {
  9. bestTime = 0;
  10. }
  11. #pragma endregion
  12.  
  13.  
  14. #pragma region Zapis_najlepszego_czasu
  15. if (player.HP <= player.minHP && timer > bestTime) {
  16. std::fstream file;
  17. file.open("scores.txt", std::ios::out);
  18. if (file.good()) {
  19. file << timer;
  20. file.close();
  21. }
  22. }
  23. #pragma endregion do pliku
Advertisement
Add Comment
Please, Sign In to add comment