<commit_before>/*************************************************************************
> File Name: Cards.cpp
> Project Name: Hearthstone++
> Author: <NAME>
> Purpose: Cards class that stores a list of cards.
> Created Time: 2017/10/10
> Copyright (c) 2017, <NAME>
*************************************************************************/
#include <Loaders/CardLoader.h>
#include <Models/Cards.h>

namespace Hearthstonepp
{
    Cards* Cards::m_instance = nullptr;

    Cards::Cards()
    {
        CardLoader loader;
        m_cards = loader.Load();
    }

    Cards::~Cards()
    {
        for (auto card : m_cards)
        {
	        if (card != nullptr)
	        {
				delete card;
	        }
        }

		m_cards.clear();
    }

    Cards* Cards::GetInstance()
    {
        if (m_instance == nullptr)
        {
            m_instance = new Cards();
        }

        return m_instance;
    }

	const Card* Cards::FindCardByID(const std::string id)
    {
		return nullptr;
    }
}<commit_msg>Update Cards - Implement FindCardByID method<commit_after>/*************************************************************************
> File Name: Cards.cpp
> Project Name: Hearthstone++
> Author: <NAME>
> Purpose: Cards class that stores a list of cards.
> Created Time: 2017/10/10
> Copyright (c) 2017, <NAME>
*************************************************************************/
#include <Loaders/CardLoader.h>
#include <Models/Cards.h>

namespace Hearthstonepp
{
    Cards* Cards::m_instance = nullptr;

    Cards::Cards()
    {
        CardLoader loader;
        m_cards = loader.Load();
    }

    Cards::~Cards()
    {
        for (auto card : m_cards)
        {
	        if (card != nullptr)
	        {
				delete card;
	        }
        }

		m_cards.clear();
    }

    Cards* Cards::GetInstance()
    {
        if (m_instance == nullptr)
        {
            m_instance = new Cards();
        }

        return m_instance;
    }

	const Card* Cards::FindCardByID(const std::string id)
    {
		for (auto card : m_cards)
		{
		    if (card->GetID() == id)
		    {
				return card;
		    }
		}

		return nullptr;
    }
}
{'fraction_non_alphanumeric': 0.24695407685098406, 'fraction_numerical': 0.011246485473289597, 'mean_word_length': 2.465909090909091, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 24, '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': '4704771', 'n_tokens_mistral': 711, 'n_tokens_neox': 616, 'n_words': 147}