<commit_before>// Copyright (c) 2018 <NAME>, <NAME>, <NAME>

// We are making my contributions/submissions to this project solely in our
// personal capacity and are not conveying any rights to any intellectual
// property of any third parties.

#ifndef HEARTHSTONEPP_CHARACTER_H
#define HEARTHSTONEPP_CHARACTER_H

#include <hspp/Cards/Entity.h>

namespace Hearthstonepp
{
class Player;

//!
//! \brief Abstract character class that stores hero and minion data.
//!
//! This class inherits from Entity class. Also, it stores some
//! attributes that only characters have such as attack and health.
//!
class Character : public Entity
{
 public:
    //! Default constructor.
    Character() = default;

    //! Constructs character with given \p card.
    //! \param card A reference to the card.
    Character(Card& card);

    //! Default destructor.
    virtual ~Character() = default;

    //! Copy constructor.
    Character(const Character& c);

    //! Copy assignment operator.
    Character& operator=(const Character& c);

    //! Clones member variables.
    Character* Clone() const override;

    //! Returns the value of attack.
    //! \return The value of attack.
    size_t GetAttack() const;

    //! Sets the value of attack.
    //! \param attack the value of attack.
    void SetAttack(size_t attack);

    //! Returns whether attack is possible.
    //! \return Whether attack is possible.
    bool CanAttack() const;

    //! Returns whether the target is valid.
    //! \param opponent The opponent player.
    //! \param target The target to attack.
    //! \return Whether the target is valid.
    bool IsValidAttackTarget(Player& opponent, Character& target) const;

    //! Returns a list of valid target.
    //! \param opponent The opponent player.
    //! \return A list of pointer to valid target.
    std::vector<Character*> GetValidAttackTargets(Player& opponent) const;

    //! Takes damage from \p source with \p damage value.
    //! \param source The character to give damage.
    //! \param damage The value of damage.
    //! \return Final damage taking into account ability.
    size_t TakeDamage(Character& source, size_t damage);

    size_t attackableCount = 0;
    size_t remainTurnToThaw = 0;
    size_t health = 0;
    size_t maxHealth = 0;

 private:
    size_t m_attack = 0;
};
}  // namespace Hearthstonepp

#endif<commit_msg>refactor: Change GetAttack method to 'virtual'<commit_after>// Copyright (c) 2018 <NAME>, <NAME>, <NAME>

// We are making my contributions/submissions to this project solely in our
// personal capacity and are not conveying any rights to any intellectual
// property of any third parties.

#ifndef HEARTHSTONEPP_CHARACTER_H
#define HEARTHSTONEPP_CHARACTER_H

#include <hspp/Cards/Entity.h>

namespace Hearthstonepp
{
class Player;

//!
//! \brief Abstract character class that stores hero and minion data.
//!
//! This class inherits from Entity class. Also, it stores some
//! attributes that only characters have such as attack and health.
//!
class Character : public Entity
{
 public:
    //! Default constructor.
    Character() = default;

    //! Constructs character with given \p card.
    //! \param card A reference to the card.
    Character(Card& card);

    //! Default destructor.
    virtual ~Character() = default;

    //! Copy constructor.
    Character(const Character& c);

    //! Copy assignment operator.
    Character& operator=(const Character& c);

    //! Clones member variables.
    Character* Clone() const override;

    //! Returns the value of attack.
    //! \return The value of attack.
    virtual size_t GetAttack() const;

    //! Sets the value of attack.
    //! \param attack the value of attack.
    void SetAttack(size_t attack);

    //! Returns whether attack is possible.
    //! \return Whether attack is possible.
    bool CanAttack() const;

    //! Returns whether the target is valid.
    //! \param opponent The opponent player.
    //! \param target The target to attack.
    //! \return Whether the target is valid.
    bool IsValidAttackTarget(Player& opponent, Character& target) const;

    //! Returns a list of valid target.
    //! \param opponent The opponent player.
    //! \return A list of pointer to valid target.
    std::vector<Character*> GetValidAttackTargets(Player& opponent) const;

    //! Takes damage from \p source with \p damage value.
    //! \param source The character to give damage.
    //! \param damage The value of damage.
    //! \return Final damage taking into account ability.
    size_t TakeDamage(Character& source, size_t damage);

    size_t attackableCount = 0;
    size_t remainTurnToThaw = 0;
    size_t health = 0;
    size_t maxHealth = 0;

 protected:
    size_t m_attack = 0;
};
}  // namespace Hearthstonepp

#endif
{'fraction_non_alphanumeric': 0.10198123044838374, 'fraction_numerical': 0.003753910323253389, 'mean_word_length': 2.870863599677159, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4645196', 'n_tokens_mistral': 1357, 'n_tokens_neox': 1290, 'n_words': 539}