JsonRandom.h 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. #pragma once
  2. #include "../GameConstants.h"
  3. #include "../ResourceSet.h"
  4. /*
  5. * JsonRandom.h, part of VCMI engine
  6. *
  7. * Authors: listed in file AUTHORS in main folder
  8. *
  9. * License: GNU General Public License v2.0 or later
  10. * Full text of license available in license.txt file, in main folder
  11. *
  12. */
  13. class JsonNode;
  14. typedef std::vector<JsonNode> JsonVector;
  15. class CRandomGenerator;
  16. class Bonus;
  17. class Component;
  18. class CStackBasicDescriptor;
  19. namespace JsonRandom
  20. {
  21. struct DLL_LINKAGE RandomStackInfo
  22. {
  23. std::vector<const CCreature *> allowedCreatures;
  24. si32 minAmount;
  25. si32 maxAmount;
  26. };
  27. DLL_LINKAGE si32 loadValue(const JsonNode & value, CRandomGenerator & rng, si32 defaultValue = 0);
  28. DLL_LINKAGE TResources loadResources(const JsonNode & value, CRandomGenerator & rng);
  29. DLL_LINKAGE std::vector<si32> loadPrimary(const JsonNode & value, CRandomGenerator & rng);
  30. DLL_LINKAGE std::map<SecondarySkill, si32> loadSecondary(const JsonNode & value, CRandomGenerator & rng);
  31. DLL_LINKAGE ArtifactID loadArtifact(const JsonNode & value, CRandomGenerator & rng);
  32. DLL_LINKAGE std::vector<ArtifactID> loadArtifacts(const JsonNode & value, CRandomGenerator & rng);
  33. DLL_LINKAGE SpellID loadSpell(const JsonNode & value, CRandomGenerator & rng, std::vector<SpellID> spells);
  34. DLL_LINKAGE std::vector<SpellID> loadSpells(const JsonNode & value, CRandomGenerator & rng, std::vector<SpellID> spells);
  35. DLL_LINKAGE CStackBasicDescriptor loadCreature(const JsonNode & value, CRandomGenerator & rng);
  36. DLL_LINKAGE std::vector<CStackBasicDescriptor> loadCreatures(const JsonNode & value, CRandomGenerator & rng);
  37. DLL_LINKAGE std::vector<RandomStackInfo> evaluateCreatures(const JsonNode & value);
  38. DLL_LINKAGE std::vector<Bonus> loadBonuses(const JsonNode & value);
  39. DLL_LINKAGE std::vector<Component> loadComponents(const JsonNode & value);
  40. }