<commit_before>// This code is based on Sabberstone project.
// Copyright (c) 2017-2018 SabberStone Team, darkfriend77 & rnilva
// Hearthstone++ is hearthstone simulator using C++ with reinforcement learning.
// Copyright (c) 2018 <NAME>, <NAME>, <NAME>

#include <hspp/Actions/Generic.hpp>
#include <hspp/Models/Minion.hpp>
#include <hspp/Models/Weapon.hpp>

namespace Hearthstonepp
{
Entity* Generic::DrawCard(Player& player, Card&& card)
{
    auto* gameAgent = player.GetGame();
    Entity* entity;

    switch (card.cardType)
    {
        case +CardType::MINION:
            entity = new Minion(gameAgent, card);
            break;
        case +CardType::SPELL:
            entity = new Spell(gameAgent, card);
            break;
        case +CardType::WEAPON:
            entity = new Weapon(gameAgent, card);
            break;
        default:
            throw std::invalid_argument(
                "Generic::DrawCard() - Invalid card type!");
    }

    player.GetHand().AddCard(*entity);

    return entity;
}
}  // namespace Hearthstonepp<commit_msg>[ci skip] style: Change variable name (gameAgent -> game)<commit_after>// This code is based on Sabberstone project.
// Copyright (c) 2017-2018 SabberStone Team, darkfriend77 & rnilva
// Hearthstone++ is hearthstone simulator using C++ with reinforcement learning.
// Copyright (c) 2018 <NAME>, <NAME>, <NAME>

#include <hspp/Actions/Generic.hpp>
#include <hspp/Models/Minion.hpp>
#include <hspp/Models/Weapon.hpp>

namespace Hearthstonepp
{
Entity* Generic::DrawCard(Player& player, Card&& card)
{
    auto* game = player.GetGame();
    Entity* entity;

    switch (card.cardType)
    {
        case +CardType::MINION:
            entity = new Minion(game, card);
            break;
        case +CardType::SPELL:
            entity = new Spell(game, card);
            break;
        case +CardType::WEAPON:
            entity = new Weapon(game, card);
            break;
        default:
            throw std::invalid_argument(
                "Generic::DrawCard() - Invalid card type!");
    }

    player.GetHand().AddCard(*entity);

    return entity;
}
}  // namespace Hearthstonepp
{'fraction_non_alphanumeric': 0.12476808905380334, 'fraction_numerical': 0.012987012987012988, 'mean_word_length': 2.643581081081081, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 16, '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': '4988860', 'n_tokens_mistral': 679, 'n_tokens_neox': 632, 'n_words': 172}