CObjectHandler.cpp 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #include "stdafx.h"
  2. #include "CObjectHandler.h"
  3. #include "CGameInfo.h"
  4. #include "CGeneralTextHandler.h"
  5. #include "CLodHandler.h"
  6. #include "CAmbarCendamo.h"
  7. void CObjectHandler::loadObjects()
  8. {
  9. int ID=0;
  10. std::string buf = CGameInfo::mainObj->bitmaph->getTextFile("OBJNAMES.TXT");
  11. int it=0;
  12. while (it<buf.length()-1)
  13. {
  14. CObject nobj;
  15. CGeneralTextHandler::loadToIt(nobj.name,buf,it,3);
  16. objects.push_back(nobj);
  17. }
  18. }
  19. bool CObjectInstance::operator <(const CObjectInstance &cmp) const
  20. {
  21. if(CGI->ac->map.defy[this->defNumber].printPriority==1 && CGI->ac->map.defy[cmp.defNumber].printPriority==0)
  22. return true;
  23. if(CGI->ac->map.defy[cmp.defNumber].printPriority==1 && CGI->ac->map.defy[this->defNumber].printPriority==0)
  24. return false;
  25. if(this->pos.y<cmp.pos.y)
  26. return true;
  27. if(this->pos.y>cmp.pos.y)
  28. return false;
  29. if(CGI->ac->map.defy[this->defNumber].isOnDefList && !(CGI->ac->map.defy[cmp.defNumber].isOnDefList))
  30. return true;
  31. if(CGI->ac->map.defy[cmp.defNumber].isOnDefList && !(CGI->ac->map.defy[this->defNumber].isOnDefList))
  32. return false;
  33. if(!CGI->ac->map.defy[this->defNumber].isVisitable() && CGI->ac->map.defy[cmp.defNumber].isVisitable())
  34. return true;
  35. if(!CGI->ac->map.defy[cmp.defNumber].isVisitable() && CGI->ac->map.defy[this->defNumber].isVisitable())
  36. return false;
  37. if(this->pos.x<cmp.pos.x)
  38. return true;
  39. return false;
  40. }