CAmbarCendamo.h 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #ifndef CAMBARCENDAMO_H
  2. #define CAMBARCENDAMO_H
  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 "CDefHandler.h"
  12. #include "CCreatureHandler.h"
  13. enum EDefType {TOWN_DEF, HERO_DEF, CREATURES_DEF, SEERHUT_DEF, RESOURCE_DEF, TERRAINOBJ_DEF, EVENTOBJ_DEF, SIGN_DEF, GARRISON_DEF, ARTIFACT_DEF, WITCHHUT_DEF, SCHOLAR_DEF, PLAYERONLY_DEF, SHRINE_DEF, SPELLSCROLL_DEF, PANDORA_DEF, GRAIL_DEF, CREGEN_DEF, CREGEN2_DEF, CREGEN3_DEF, BORDERGUARD_DEF};
  14. class CAmbarCendamo
  15. {
  16. public:
  17. /////////////////zmienne skladowe
  18. Mapa map;
  19. std::ifstream * is; // stream used to read map file
  20. int andame; // length of map file
  21. unsigned char * bufor; // here we store map bytecode
  22. std::vector<CDefHandler*> defs;
  23. /////////////////funkcje skladowe
  24. CAmbarCendamo (const char * tie); // c-tor; tie is the path of the map file
  25. CAmbarCendamo (unsigned char * map); // c-tor; map is pointer to array containing map; it is not copied, so don't delete
  26. ~CAmbarCendamo (); // d-tor
  27. 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
  28. void teceDef (); // create files with info about defs
  29. void deh3m(); // decode file, results are stored in map
  30. void processMap(std::vector<std::string> & defsToUnpack); //choose castles, creatures, resources, artifacts...
  31. ////
  32. std::vector<std::string> resDefNames;
  33. ////
  34. void loadDefs();
  35. EDefType getDefType(DefInfo& a); //returns type of object in def
  36. CCreatureSet readCreatureSet(int pos, int number = 7); //reads creature set in most recently encountered format; reades number units (default is 7)
  37. };
  38. #endif //CAMBARCENDAMO_H