CDefObjInfoHandler.cpp 618 B

1234567891011121314151617181920212223242526272829
  1. #include "stdafx.h"
  2. #include "CDefObjInfoHandler.h"
  3. #include "CGameInfo.h"
  4. #include <sstream>
  5. bool DefObjInfo::operator==(const std::string & por) const
  6. {
  7. return this->defName == por;
  8. }
  9. void CDefObjInfoHandler::load()
  10. {
  11. std::istringstream inp(CGameInfo::mainObj->bitmaph->getTextFile("ZOBJCTS.TXT"));
  12. int objNumber;
  13. inp>>objNumber;
  14. for(int hh=0; hh<objNumber; ++hh)
  15. {
  16. DefObjInfo nobj;
  17. std::string dump;
  18. inp>>nobj.defName;
  19. for(int yy=0; yy<4; ++yy)
  20. inp>>dump;
  21. inp>>nobj.type;
  22. inp>>nobj.subtype;
  23. inp>>nobj.objType;
  24. inp>>nobj.priority;
  25. objs.push_back(nobj);
  26. }
  27. }