CCreatureHandler.h 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. #ifndef CCREATUREHANDLER_H
  2. #define CCREATUREHANDLER_H
  3. #include <string>
  4. #include <vector>
  5. #include <map>
  6. #include "CDefHandler.h"
  7. class CCreature
  8. {
  9. public:
  10. std::string namePl, nameSing, nameRef; //name in singular and plural form; and reference name
  11. int wood, mercury, ore, sulfur, crystal, gems, gold, fightValue, AIValue, growth, hordeGrowth, hitPoints, speed, attack, defence, shots, spells;
  12. int low1, low2, high1, high2; //TODO - co to w ogóle jest???
  13. std::string abilityText; //description of abilities
  14. std::string abilityRefs; //references to abilities, in textformat
  15. int idNumber;
  16. ///animation info
  17. float timeBetweenFidgets, walkAnimationTime, attackAnimationTime, flightAnimationDistance;
  18. int upperRightMissleOffsetX, rightMissleOffsetX, lowerRightMissleOffsetX, upperRightMissleOffsetY, rightMissleOffsetY, lowerRightMissleOffsetY;
  19. float missleFrameAngles[12];
  20. int troopCountLocationOffset, attackClimaxFrame;
  21. ///end of anim info
  22. //for some types of towns
  23. bool isDefinite; //if the creature type is wotn dependent, it should be true
  24. int indefLevel; //only if indefinite
  25. bool indefUpgraded; //onlu if inddefinite
  26. //end
  27. CDefHandler * battleAnimation;
  28. //TODO - zdolnoœci - na typie wyliczeniowym czy czymœ
  29. };
  30. class CCreatureSet //seven combined creatures
  31. {
  32. public:
  33. std::map<int,std::pair<CCreature*,int> > slots;
  34. //CCreature * slot1, * slot2, * slot3, * slot4, * slot5, * slot6, * slot7; //types of creatures on each slot
  35. //unsigned int s1, s2, s3, s4, s5, s6, s7; //amounts of units in slots
  36. bool formation; //false - wide, true - tight
  37. };
  38. class CCreatureHandler
  39. {
  40. public:
  41. std::vector<CCreature> creatures;
  42. std::map<std::string,int> nameToID;
  43. void loadCreatures();
  44. void loadAnimationInfo();
  45. void loadUnitAnimInfo(CCreature & unit, std::string & src, int & i);
  46. void loadUnitAnimations();
  47. };
  48. #endif //CCREATUREHANDLER_H