ProxyCaster.cpp 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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. namespace spells
  14. {
  15. ProxyCaster::ProxyCaster(const Caster * actualCaster_)
  16. : actualCaster(actualCaster_)
  17. {
  18. }
  19. ProxyCaster::~ProxyCaster() = default;
  20. int32_t ProxyCaster::getCasterUnitId() const
  21. {
  22. return actualCaster->getCasterUnitId();
  23. }
  24. ui8 ProxyCaster::getSpellSchoolLevel(const Spell * spell, int * outSelectedSchool) const
  25. {
  26. return actualCaster->getSpellSchoolLevel(spell, outSelectedSchool);
  27. }
  28. int ProxyCaster::getEffectLevel(const Spell * spell) const
  29. {
  30. return actualCaster->getEffectLevel(spell);
  31. }
  32. int64_t ProxyCaster::getSpellBonus(const Spell * spell, int64_t base, const battle::Unit * affectedStack) const
  33. {
  34. return actualCaster->getSpellBonus(spell, base, affectedStack);
  35. }
  36. int64_t ProxyCaster::getSpecificSpellBonus(const Spell * spell, int64_t base) const
  37. {
  38. return actualCaster->getSpecificSpellBonus(spell, base);
  39. }
  40. int ProxyCaster::getEffectPower(const Spell * spell) const
  41. {
  42. return actualCaster->getEffectPower(spell);
  43. }
  44. int ProxyCaster::getEnchantPower(const Spell * spell) const
  45. {
  46. return actualCaster->getEnchantPower(spell);
  47. }
  48. int64_t ProxyCaster::getEffectValue(const Spell * spell) const
  49. {
  50. return actualCaster->getEffectValue(spell);
  51. }
  52. const PlayerColor ProxyCaster::getOwner() const
  53. {
  54. return actualCaster->getOwner();
  55. }
  56. void ProxyCaster::getCasterName(MetaString & text) const
  57. {
  58. return actualCaster->getCasterName(text);
  59. }
  60. void ProxyCaster::getCastDescription(const Spell * spell, const std::vector<const battle::Unit*> & attacked, MetaString & text) const
  61. {
  62. actualCaster->getCastDescription(spell, attacked, text);
  63. }
  64. void ProxyCaster::spendMana(const PacketSender * server, const int spellCost) const
  65. {
  66. actualCaster->spendMana(server, spellCost);
  67. }
  68. }