CAmbarCendamo.h 1.4 KB

1234567891011121314151617181920212223242526272829303132
  1. #ifndef CAMBARCENDAMO_H
  2. #define CAMBARCENDAMO_H
  3. #include <iostream>
  4. #include <string>
  5. #include <vector>
  6. #include "../global.h"
  7. #include "SDL.h"
  8. #include "../map.h"
  9. #include "CDefHandler.h"
  10. #include "CCreatureHandler.h"
  11. 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, HEROPLACEHOLDER_DEF};
  12. class CAmbarCendamo
  13. {
  14. public:
  15. /////////////////member variables
  16. Mapa map;
  17. //map file
  18. unsigned char * bufor; // here we store map bytecode
  19. int i; //our pos in the file
  20. CAmbarCendamo (const char * tie); // c-tor; tie is the path of the map file
  21. CAmbarCendamo (unsigned char * map); // c-tor; map is pointer to array containing map; it is not copied, so don't delete
  22. ~CAmbarCendamo (); // d-tor
  23. 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
  24. void deh3m(); // decode file, results are stored in map
  25. EDefType getDefType(CGDefInfo * a); //returns type of object in def
  26. CCreatureSet readCreatureSet(int number = 7); //reads creature set in most recently encountered format; reades number units (default is 7)
  27. };
  28. #endif //CAMBARCENDAMO_H