Advertisement
Guest User

Untitled

a guest
May 29th, 2015
245
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.84 KB | None | 0 0
  1. std::wifstream informationFile;
  2.     informationFile.open("./Resources/GameInit.txt");
  3.  
  4.     std::wstring extractedLine;
  5.     std::wstringstream objectInformation;
  6.     if (informationFile.fail() == true)
  7.     {
  8.         GAME_ENGINE->MessageBox(String("Failed to open GameInit.txt"));
  9.         GAME_ENGINE->QuitGame();
  10.     }
  11.  
  12.     while (informationFile.eof() == false)
  13.     {
  14.         std::getline(informationFile, extractedLine);
  15.         if (extractedLine.find(L"Pickup") != std::wstring::npos && extractedLine.find(L"//") == std::wstring::npos)
  16.         {
  17.             while (extractedLine.find(L"/>") == std::wstring::npos)
  18.             {
  19.                 objectInformation << extractedLine;
  20.                 std::getline(informationFile, extractedLine);
  21.             }
  22.             OutputDebugString(String(objectInformation.str().c_str()) + String("\n"));
  23.             CreateObject(objectInformation);
  24.             objectInformation.str(L"");
  25.            
  26.         }
  27.     }
  28.         informationFile.close();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement