CAmbarCendamo.h 1.3 KB

12345678910111213141516171819202122232425262728293031323334
  1. #ifndef AMBARCENDD
  2. #define AMBARCENDD
  3. #include <iostream>
  4. #include <fstream>
  5. #include <string>
  6. #include <vector>
  7. #include "global.h"
  8. #include "SDL.h"
  9. #include "map.h"
  10. #include "CSemiDefHandler.h"
  11. #include "CCreatureHandler.h"
  12. enum EDefType {TOWN_DEF, HERO_DEF, CREATURES_DEF, SEERHUT_DEF, RESOURCE_DEF, TERRAINOBJ_DEF, EVENTOBJ_DEF, SIGN_DEF, GARRISON_DEF};
  13. class CAmbarCendamo
  14. {
  15. public:
  16. /////////////////zmienne skladowe
  17. Mapa map;
  18. std::ifstream * is; // stream used to read map file
  19. int andame; // length of map file
  20. unsigned char * bufor; // here we store map bytecode
  21. std::vector<CSemiDefHandler*> defs;
  22. /////////////////funkcje skladowe
  23. CAmbarCendamo (const char * tie); // c-tor; tie is the path of the map file
  24. ~CAmbarCendamo (); // d-tor
  25. int readNormalNr (int pos, int bytCon=4, bool cyclic = false); //read number from bytCon bytes starting from pos position in buffer ; if cyclic is true, number is treated as it were signed number with bytCon bytes
  26. void teceDef (); // create files with info about defs
  27. void deh3m(); // decode file, results are stored in map
  28. void loadDefs();
  29. EDefType getDefType(DefInfo& a); //returns type of object in def
  30. CCreatureSet readCreatureSet(int pos, int number = 7); //reads creature set in most recently encountered format; reades number units (default is 7)
  31. };
  32. #endif //AMBARCENDD