Public paste
save to txt file
By: serializer | Date: Feb 5 2010 16:06 | Format: None | Expires: never | Size: 887 B | Hits: 928

  1. //---------------------------
  2. // Includes
  3. //---------------------------
  4. #include "Serializer.h"
  5.  
  6. //---------------------------
  7. // Defines
  8. //---------------------------
  9. #define GAME_ENGINE (GameEngine::GetSingleton())
  10.  
  11. //---------------------------
  12. // Constructor & Destructor
  13. //---------------------------
  14. Serializer::Serializer()
  15. {
  16.         m_myfile.open("textfiles\Save.txt", ios::out | ios::trunc);
  17.         // nothing to create
  18. }
  19.  
  20. Serializer::~Serializer()
  21. {
  22.         m_myfile.close();
  23.         // nothing to destroy
  24. }
  25. void Serializer::writelinetofile(int place, int type)
  26. {
  27.         if(m_myfile.is_open() )
  28.         {
  29.                 m_myfile << place;
  30.                 m_myfile << " ";
  31.                 m_myfile << type;
  32.                 m_myfile << "n";
  33.         }
  34.         else
  35.         {
  36.                 GAME_ENGINE->MessageBox(String("Can't write to file!"));
  37.         }
  38. }
  39. //---------------------------
  40. // Eigen methoden
  41. //---------------------------
  42.  
  43. // vul aan met je eigen methoden.