ProxyCaster.cpp 2.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /*
  2. * ProxyCaster.cpp, part of VCMI engine
  3. *
  4. * Authors: listed in file AUTHORS in main folder
  5. *
  6. * License: GNU General Public License v2.0 or later
  7. * Full text of license available in license.txt file, in main folder
  8. *
  9. */
  10. #include "StdInc.h"
  11. #include "ProxyCaster.h"
  12. #include "../GameConstants.h"
  13. VCMI_LIB_NAMESPACE_BEGIN
  14. namespace spells
  15. {
  16. ProxyCaster::ProxyCaster(const Caster * actualCaster_)
  17. : actualCaster(actualCaster_)
  18. {
  19. }
  20. ProxyCaster::~ProxyCaster() = default;
  21. int32_t ProxyCaster::getCasterUnitId() const
  22. {
  23. return actualCaster->getCasterUnitId();
  24. }
  25. int32_t ProxyCaster::getSpellSchoolLevel(const Spell * spell, int32_t * outSelectedSchool) const
  26. {
  27. return actualCaster->getSpellSchoolLevel(spell, outSelectedSchool);
  28. }
  29. int32_t ProxyCaster::getEffectLevel(const Spell * spell) const
  30. {
  31. return actualCaster->getEffectLevel(spell);
  32. }
  33. int64_t ProxyCaster::getSpellBonus(const Spell * spell, int64_t base, const battle::Unit * affectedStack) const
  34. {
  35. return actualCaster->getSpellBonus(spell, base, affectedStack);
  36. }
  37. int64_t ProxyCaster::getSpecificSpellBonus(const Spell * spell, int64_t base) const
  38. {
  39. return actualCaster->getSpecificSpellBonus(spell, base);
  40. }
  41. int32_t ProxyCaster::getEffectPower(const Spell * spell) const
  42. {
  43. return actualCaster->getEffectPower(spell);
  44. }
  45. int32_t ProxyCaster::getEnchantPower(const Spell * spell) const
  46. {
  47. return actualCaster->getEnchantPower(spell);
  48. }
  49. int64_t ProxyCaster::getEffectValue(const Spell * spell) const
  50. {
  51. return actualCaster->getEffectValue(spell);
  52. }
  53. PlayerColor ProxyCaster::getCasterOwner() const
  54. {
  55. return actualCaster->getCasterOwner();
  56. }
  57. void ProxyCaster::getCasterName(MetaString & text) const
  58. {
  59. return actualCaster->getCasterName(text);
  60. }
  61. void ProxyCaster::getCastDescription(const Spell * spell, const std::vector<const battle::Unit*> & attacked, MetaString & text) const
  62. {
  63. actualCaster->getCastDescription(spell, attacked, text);
  64. }
  65. void ProxyCaster::spendMana(ServerCallback * server, const int32_t spellCost) const
  66. {
  67. actualCaster->spendMana(server, spellCost);
  68. }
  69. int32_t ProxyCaster::manaLimit() const
  70. {
  71. if(actualCaster)
  72. return actualCaster->manaLimit();
  73. return 0;
  74. }
  75. }
  76. VCMI_LIB_NAMESPACE_END