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

namespace SDA
{
	// Lazy loading creates object when it is requested.
	AttackState* AttackState::_instance = nullptr;

	AttackState::AttackState()
	{
	}

	AttackState::~AttackState()
	{
	}

	AttackState* AttackState::GetInstance()
	{
		// Lazy loading.
		if (!_instance)
		{
			_instance = new AttackState();
		}
		return _instance;
	}

	void AttackState::Enter(GameCharacter* t)
	{
		std::cout << "Start the fight!" << std::endl;
	}

	void AttackState::Execute(GameCharacter* t)
	{
		std::cout << "Fighting" << std::endl;
	}

	void AttackState::Exit(GameCharacter* t)<commit_msg>AttackState now switches to HideState when necessary.<commit_after>#include "AttackState.h"
#include "HideState.h"
#include <iostream>

namespace SDA
{
	// Lazy loading creates object when it is requested.
	AttackState* AttackState::_instance = nullptr;

	AttackState::AttackState()
	{
	}

	AttackState::~AttackState()
	{
	}

	AttackState* AttackState::GetInstance()
	{
		// Lazy loading.
		if (!_instance)
		{
			_instance = new AttackState();
		}
		return _instance;
	}

	void AttackState::Enter(GameCharacter* t)
	{
		std::cout << "Start the fight!" << std::endl;
	}

	void AttackState::Execute(GameCharacter* t)
	{
		std::cout << "Fighting..." << std::endl;

		// Make the gamecharacter weaker.
		t->SetStrength(t->GetStrength() - 1);

		// We're wounded, go hide!
		if (t->GetStrength() < 5)
		{
			t->ChangeState(HideState::GetInstance());
		}
	}

	void AttackState::Exit(GameCharacter* t)
{'fraction_non_alphanumeric': 0.15104166666666666, 'fraction_numerical': 0.0013020833333333333, 'mean_word_length': 4.2457337883959045, 'pattern_counts': {'":': 0, '<': 22, '<?xml version=': 0, '>': 9, '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': '7636935', 'n_tokens_mistral': 598, 'n_tokens_neox': 537, 'n_words': 115}