CCastleHandler.h 1.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. #ifndef CCASTLEHANDLER_H
  2. #define CCASTLEHANDLER_H
  3. #include "CBuildingHandler.h"
  4. #include "CHeroHandler.h"
  5. #include "CObjectHandler.h"
  6. #include "CCreatureHandler.h"
  7. class CCastleEvent
  8. {
  9. public:
  10. std::string name, message;
  11. int wood, mercury, ore, sulfur, crystal, gems, gold; //gain / loss of resources
  12. unsigned char players; //players for whom this event can be applied
  13. bool forHuman, forComputer;
  14. int firstShow; //postpone of first encounter time in days
  15. int forEvery; //every n days this event will occure
  16. unsigned char bytes[6]; //build specific buildings (raw format, similar to town's)
  17. int gen[7]; //additional creatures in i-th level dwelling
  18. };
  19. class CCastleObjInfo : public CSpecObjInfo //castle class
  20. {
  21. public:
  22. int x, y, z; //posiotion
  23. std::vector<CBuilding> buildings; //buildings we can build in this castle
  24. std::vector<bool> isBuild; //isBuild[i] is true, when building buildings[i] has been built
  25. std::vector<bool> isLocked; //isLocked[i] is true, when building buildings[i] canot be built
  26. bool unusualBuildins; //if true, intrepret bytes below
  27. unsigned char buildingSettings[12]; //raw format for two vectors above (greatly depends on town type)
  28. bool hasFort; //used only if unusualBuildings is false
  29. CHero * visitingHero;
  30. CHero * garnisonHero;
  31. unsigned char bytes[4]; //identifying bytes
  32. unsigned char player; //255 - nobody, players 0 - 7
  33. std::string name; //town name
  34. CCreatureSet garrison;
  35. std::vector<CSpell *> possibleSpells;
  36. std::vector<CSpell *> obligatorySpells;
  37. std::vector<CSpell *> availableSpells;
  38. std::vector<CCastleEvent> events;
  39. unsigned char alignment; //255 - same as owner/random, 0 - same as red, 1 - same as blue, etc
  40. };
  41. #endif //CCASTLEHANDLER_H