<commit_before>#include <iostream>
#include "cMapper.h"

cMapper* cMapper::thisPointer = NULL;
bool cMapper::instanceFlag = false;

cMapper* cMapper::getInstance() {
    if (!instanceFlag)
    {
        thisPointer = new cMapper();
        instanceFlag = true;
        return thisPointer;
    }
    else
    {
        return thisPointer;
    }
}

void cMapper::add(gameEntity *ent) {
    entityContainer.push_back(ent);
    std::cout << "Added gameEntity: " << ent->name() << " to container!\n";
}

void cMapper::showEntities() {
    std::vector<gameEntity*>::iterator iter = entityContainer.begin();
    std::cout << "mapper contains: ";
    for (;iter < entityContainer.end();iter++)
        std::cout << (*iter)->name() << ", ";
    std::cout << "\n";
}

void cMapper::update(long frametime) {
    std::vector<gameEntity*>::iterator iter = entityContainer.begin();

    for (;iter < entityContainer.end();iter++)
        (*iter)->update(frametime);
}

gameEntity* cMapper::getTarget() {
    std::vector<gameEntity*>::iterator iter = entityContainer.begin();

    for (;iter < entityContainer.end();iter++)
        if ((*iter)->name() == "Enemy")
            return (*iter);
}

void cMapper::deleteInstance(gameEntity *instance) {
    std::vector<gameEntity*>::iterator iter = entityContainer.begin();
    for (;iter < entityContainer.end();iter++)
        if ((*iter) == instance)
            entityContainer.erase(iter);
}<commit_msg>Return value fix in cMapper getTarget.<commit_after>#include <iostream>
#include "cMapper.h"

cMapper* cMapper::thisPointer = NULL;
bool cMapper::instanceFlag = false;

cMapper* cMapper::getInstance() {
    if (!instanceFlag)
    {
        thisPointer = new cMapper();
        instanceFlag = true;
        return thisPointer;
    }
    else
    {
        return thisPointer;
    }
}

void cMapper::add(gameEntity *ent) {
    entityContainer.push_back(ent);
    std::cout << "Added gameEntity: " << ent->name() << " to container!\n";
}

void cMapper::showEntities() {
    std::vector<gameEntity*>::iterator iter = entityContainer.begin();
    std::cout << "mapper contains: ";
    for (;iter < entityContainer.end();iter++)
        std::cout << (*iter)->name() << ", ";
    std::cout << "\n";
}

void cMapper::update(long frametime) {
    std::vector<gameEntity*>::iterator iter = entityContainer.begin();

    for (;iter < entityContainer.end();iter++)
        (*iter)->update(frametime);
}

gameEntity* cMapper::getTarget() {
    std::vector<gameEntity*>::iterator iter = entityContainer.begin();

    for (;iter < entityContainer.end();iter++)
        if ((*iter)->name() == "Enemy")
            return (*iter);
    return NULL;
}

void cMapper::deleteInstance(gameEntity *instance) {
    std::vector<gameEntity*>::iterator iter = entityContainer.begin();
    for (;iter < entityContainer.end();iter++)
        if ((*iter) == instance)
            entityContainer.erase(iter);
}
{'fraction_non_alphanumeric': 0.17546264564770392, 'fraction_numerical': 0.0, 'mean_word_length': 3.5824175824175826, 'pattern_counts': {'":': 0, '<': 49, '<?xml version=': 0, '>': 21, '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': '3047961', 'n_tokens_mistral': 879, 'n_tokens_neox': 869, 'n_words': 177}