<commit_before>#include <gmock/gmock.h>

class IFileSystem
{
public:

};

class FileSystem : public IFileSystem
{
public:

};

// AOPC, AOPSX, FoosMod etc
class GameDefinition
{
public:
    std::string mName;
    std::string mDescription;
    std::string mAuthor;
    // TODO: initial level, how maps connect, etc.
    // Depends on DataSets
};

class DataSet
{
public:
    DataSet(const char* dataSetPath, const char* dataSetName)
    {

    }

    // TODO: File that ids this data set
    // Files in dataset
    std::vector<std::string> mFiles;
};

template<class T>
class Resource
{
public:
    void Reload()
    {

    }
};

class Animation
{
public:

};

using TAnimationResource = Resource < Animation >;

class ResourceLocator
{
public:
    ResourceLocator(IFileSystem& fileSystem, GameDefinition& game)
    {

    }

    void AddDataSet(DataSet& set, int priority)
    {

    }

    void AddAnimationMapping(const char* resourceName, const char* dataSetName, int id, int animationIndex, int blendingMode)
    {

    }

    template<typename T>
    Resource<T>* Locate(const char* resourceName)
    {
        // For each data set attempt to find resourceName by mapping
        // to a LVL/file/chunk. Or in the case of a mod dataset something else.
    }

    template<typename T>
    Resource<T>* LocateOriginal(const char* dataSetName, const char* lvlName, const char* fileName, int id, int animationIndex, int blendMode)
    {

    }
};

TEST(ResourceLocator, Locate)
{
    GameDefinition aePc;
    aePc.mAuthor = "Oddworld Inhabitants";
    aePc.mDescription = "The original PC version of Oddworld Abe's Exoddus";
    aePc.mName = "Oddworld Abe's Exoddus PC";

    FileSystem fs;
    ResourceLocator locator(fs, aePc);

    DataSet aePcCd1("C:\\dataset_location", "AEPCCD1");
    aePcCd1.mFiles.push_back("mi.lvl\\ABEBSIC.BAN");
    aePcCd1.mFiles.push_back("INGRDNT.DDV");

    locator.AddDataSet(aePcCd1, 1);

    locator.AddAnimationMapping("AbeWalkLeft", "ABEBSIC.BAN", 10, 1, 2);

    // TODO: Still want raw access to use "raw" data for debugging. e.g load pc and psx version of the sprite for AbeWalkLeft, maybe demo and mod override too.
    // or could just create a mapper per data set (?)
    TAnimationResource* resMapped = locator.Locate<Animation>("AbeWalkLeft");
    resMapped->Reload();

    TAnimationResource* resDirect = locator.LocateOriginal<Animation>("AEPCCD1", "mi.lvl", "ABEBSIC.BAN", 10, 1, 2);
}<commit_msg>stubs<commit_after>#include <gmock/gmock.h>

class IFileSystem
{
public:

};

class FileSystem : public IFileSystem
{
public:

};

// AOPC, AOPSX, FoosMod etc
class GameDefinition
{
public:
    std::string mName;
    std::string mDescription;
    std::string mAuthor;
    // TODO: initial level, how maps connect, etc.
    // Depends on DataSets
};

class DataSet
{
public:
    DataSet(const char* dataSetPath, const char* dataSetName)
    {
        std::ignore = dataSetPath;
        std::ignore = dataSetName;
    }

    // TODO: File that ids this data set
    // Files in dataset
    std::vector<std::string> mFiles;
};

template<class T>
class Resource
{
public:
    void Reload()
    {

    }
};

class Animation
{
public:

};

using TAnimationResource = Resource < Animation >;

class ResourceLocator
{
public:
    ResourceLocator(IFileSystem& fileSystem, GameDefinition& game)
    {
        std::ignore = fileSystem;
        std::ignore = game;
    }

    void AddDataSet(DataSet& set, int priority)
    {
        std::ignore = set;
        std::ignore = priority;
    }

    void AddAnimationMapping(const char* resourceName, const char* dataSetName, int id, int animationIndex, int blendingMode)
    {
        std::ignore = resourceName;
        std::ignore = dataSetName;
        std::ignore = id;
        std::ignore = animationIndex;
        std::ignore = blendingMode;
    }

    template<typename T>
    Resource<T>* Locate(const char* resourceName)
    {
        // For each data set attempt to find resourceName by mapping
        // to a LVL/file/chunk. Or in the case of a mod dataset something else.
        std::ignore = resourceName;
        return nullptr;
    }

    template<typename T>
    Resource<T>* LocateOriginal(const char* dataSetName, const char* lvlName, const char* fileName, int id, int animationIndex, int blendMode)
    {
        std::ignore = dataSetName;
        std::ignore = lvlName;
        std::ignore = fileName;
        std::ignore = id;
        std::ignore = animationIndex;
        std::ignore = blendMode;
        return nullptr;
    }
};

TEST(ResourceLocator, Locate)
{
    GameDefinition aePc;
    aePc.mAuthor = "Oddworld Inhabitants";
    aePc.mDescription = "The original PC version of Oddworld Abe's Exoddus";
    aePc.mName = "Oddworld Abe's Exoddus PC";

    FileSystem fs;
    ResourceLocator locator(fs, aePc);

    DataSet aePcCd1("C:\\dataset_location", "AEPCCD1");
    aePcCd1.mFiles.push_back("mi.lvl\\ABEBSIC.BAN");
    aePcCd1.mFiles.push_back("INGRDNT.DDV");

    locator.AddDataSet(aePcCd1, 1);

    locator.AddAnimationMapping("AbeWalkLeft", "ABEBSIC.BAN", 10, 1, 2);

    // TODO: Still want raw access to use "raw" data for debugging. e.g load pc and psx version of the sprite for AbeWalkLeft, maybe demo and mod override too.
    // or could just create a mapper per data set (?)
    TAnimationResource* resMapped = locator.Locate<Animation>("AbeWalkLeft");
    resMapped->Reload();

    TAnimationResource* resDirect = locator.LocateOriginal<Animation>("AEPCCD1", "mi.lvl", "ABEBSIC.BAN", 10, 1, 2);
    resDirect->Reload();
}
{'fraction_non_alphanumeric': 0.11195240670632775, 'fraction_numerical': 0.005408328826392645, 'mean_word_length': 3.1526946107784433, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 26, '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': '4203833', 'n_tokens_mistral': 1903, 'n_tokens_neox': 1824, 'n_words': 495}