<commit_before>#include "stdafx.h"
#include "fg_game.h"
#include "fg_card.h"
#include "fg_xml_parse.h"
#include <ctime>

CFGGame::CFGGame()
{
    m_iBattleDamageLift = 0;
}

CFGGame::~CFGGame()
{
}

BOOL CFGGame::_DealCard(UINT nNum)
{
    FGCard card;

    for (UINT n = 0; n < nNum; ++n)
    {
        GenerateCard(card);
        m_PlayerSeft.AddCard(card);
    }

    return TRUE;
}

BOOL CFGGame::Initialize()
{
    CFGXMLParse parsexml;
    VECFGCARD vecCard;
    srand((unsigned int)time(NULL));
    _DealCard(8);
    m_PlayerSeft.AddLift(10);
    m_PlayerComputer.AddLift(10);

    wchar_t filePath[MAX_PATH] = {0};
    ::GetModuleFileNameW(0, filePath, MAX_PATH);
    ::PathRemoveFileSpecW(filePath);
    ::PathAppendW(filePath, _T("cards.xml"));
    parsexml.Parse(filePath, vecCard);
    return TRUE;
}

BOOL CFGGame::Unitialize()
{
    return TRUE;
}

BOOL CFGGame::OutCard(UINT nIndex)
{
    BOOL bReturn = FALSE;

    int iSelfLife = 0;
    int iComputerLift = 0;

    FGCard outCard;
    FGCard outCardComputer;
    FGCard dealCard;

    if (!m_PlayerSeft.OutCard(nIndex, outCard))
    {
        goto Exit;
    }

    GenerateCard(outCardComputer);
    GenerateCard(dealCard);
    Fight(outCard, outCardComputer, iSelfLife, iComputerLift);
    m_PlayerSeft.AddLift(iSelfLife);
    m_PlayerSeft.AddCard(dealCard);<commit_msg>* circe 改cards.xml的路径<commit_after>#include "stdafx.h"
#include "fg_game.h"
#include "fg_card.h"
#include "fg_xml_parse.h"
#include <ctime>

CFGGame::CFGGame()
{
    m_iBattleDamageLift = 0;
}

CFGGame::~CFGGame()
{
}

BOOL CFGGame::_DealCard(UINT nNum)
{
    FGCard card;

    for (UINT n = 0; n < nNum; ++n)
    {
        GenerateCard(card);
        m_PlayerSeft.AddCard(card);
    }

    return TRUE;
}

BOOL CFGGame::Initialize()
{
    CFGXMLParse parsexml;
    VECFGCARD vecCard;
    srand((unsigned int)time(NULL));
    _DealCard(8);
    m_PlayerSeft.AddLift(10);
    m_PlayerComputer.AddLift(10);

    parsexml.Parse(L".\\data\\cards.xml", vecCard);
    return TRUE;
}

BOOL CFGGame::Unitialize()
{
    return TRUE;
}

BOOL CFGGame::OutCard(UINT nIndex)
{
    BOOL bReturn = FALSE;

    int iSelfLife = 0;
    int iComputerLift = 0;

    FGCard outCard;
    FGCard outCardComputer;
    FGCard dealCard;

    if (!m_PlayerSeft.OutCard(nIndex, outCard))
    {
        goto Exit;
    }

    GenerateCard(outCardComputer);
    GenerateCard(dealCard);
    Fight(outCard, outCardComputer, iSelfLife, iComputerLift);
    m_PlayerSeft.AddLift(iSelfLife);
    m_PlayerSeft.AddCard(dealCard);
{'fraction_non_alphanumeric': 0.13019390581717452, 'fraction_numerical': 0.007914523149980214, 'mean_word_length': 3.4743362831858406, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 9}, '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': '5136182', 'n_tokens_mistral': 1024, 'n_tokens_neox': 994, 'n_words': 170}