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

#include <Rosetta/Actions/Choose.hpp>
#include <Rosetta/Tasks/PlayerTasks/ChooseTask.hpp>

namespace RosettaStone::PlayerTasks
{
ChooseTask::ChooseTask(std::vector<std::size_t> choices) : m_choices(choices)
{
    // Do nothing
}

ChooseTask ChooseTask::Mulligan(Player&, std::vector<std::size_t> choices)
{
    return ChooseTask(choices);
}

TaskID ChooseTask::GetTaskID() const
{
    return TaskID::CHOOSE;
}

TaskStatus ChooseTask::Impl(Player& player)
{
    switch (player.choice.value().choiceType)
    {
        case ChoiceType::MULLIGAN:
            Generic::ChoiceMulligan(player, m_choices);
            player.mulliganState = Mulligan::DONE;
            break;
        case ChoiceType::GENERAL:
            break;
        default:
            throw std::invalid_argument(
                "ChooseTask::Impl() - Invalid choice type!");
    }

    return TaskStatus::COMPLETE;
}
}  // namespace RosettaStone::PlayerTasks<commit_msg>refactor: Assign argument 'choices' as rvalue reference using std::move<commit_after>// This code is based on Sabberstone project.
// Copyright (c) 2017-2019 SabberStone Team, darkfriend77 & rnilva
// RosettaStone is hearthstone simulator using C++ with reinforcement learning.
// Copyright (c) 2019 <NAME>, <NAME>, <NAME>

#include <Rosetta/Actions/Choose.hpp>
#include <Rosetta/Tasks/PlayerTasks/ChooseTask.hpp>

#include <utility>

namespace RosettaStone::PlayerTasks
{
ChooseTask::ChooseTask(std::vector<std::size_t> choices)
    : m_choices(std::move(choices))
{
    // Do nothing
}

ChooseTask ChooseTask::Mulligan(Player&, std::vector<std::size_t> choices)
{
    return ChooseTask(std::move(choices));
}

TaskID ChooseTask::GetTaskID() const
{
    return TaskID::CHOOSE;
}

TaskStatus ChooseTask::Impl(Player& player)
{
    switch (player.choice.value().choiceType)
    {
        case ChoiceType::MULLIGAN:
            Generic::ChoiceMulligan(player, m_choices);
            player.mulliganState = Mulligan::DONE;
            break;
        case ChoiceType::GENERAL:
            break;
        default:
            throw std::invalid_argument(
                "ChooseTask::Impl() - Invalid choice type!");
    }

    return TaskStatus::COMPLETE;
}
}  // namespace RosettaStone::PlayerTasks
{'fraction_non_alphanumeric': 0.12379421221864952, 'fraction_numerical': 0.011254019292604502, 'mean_word_length': 3.6436567164179103, 'pattern_counts': {'":': 0, '<': 18, '<?xml version=': 0, '>': 18, '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': '407410', 'n_tokens_mistral': 808, 'n_tokens_neox': 753, 'n_words': 165}