示例#1
0
    public ISaveSystem CreateSaveSystemForPathFindProcessMetric(
        string currentMazeDirectory,
        string defaultSaveFolderPath,
        IPathFindProcessMetricCollector pathFindProcessMetricCollector)
    {
        ISaveSystem   saveSystem;
        List <string> saveText = new List <string>();


        saveSystem = new SaveSystem(
            new FolderPath(
                currentMazeDirectory,
                defaultSaveFolderPath,
                new PathValidator()),
            new PathFindProcessMetricSaveTextCreator(
                pathFindProcessMetricCollector,
                saveText,
                new AnalyticPathFindMetricFormat(
                    saveText,
                    pathFindProcessMetricCollector)),
            new List <string>(),
            new StreamWriter(currentMazeDirectory, false));

        return(saveSystem);
    }
示例#2
0
    public void _1_1_AddToListForAnalyticMetricFormat_ContainCheck()
    {
        List <string> text = new List <string>();
        IPathFindProcessMetricCollector pathFindProcessMetricCollector = GetPathFindProcessMetricCollector(1, 2, 3, 4, 5, 6, 7);

        AnalyticPathFindMetricFormat analyticPathFindMetricFormat = new AnalyticPathFindMetricFormat(text, pathFindProcessMetricCollector);

        analyticPathFindMetricFormat.AddToListForAnalyticMetricFormat();

        Assert.AreEqual(text[0], "");
        Assert.AreEqual(text[1], "Analytic Format: ");
        Assert.AreEqual(text[2], "1 | 2 | 3 | 4 | 5 | 6 | 7");
    }
    public void SaveMetricForPathFindProcess(IPathFindProcessMetricCollector pathFindProcessMetric, EPathFindAlgorithms pathFindAlgorithms)
    {
        string currentMazeDirectory;

        try
        {
            currentMazeDirectory = transform.GetComponent <LoadSystemBoundary>().GetCurrentMazeDirectionFolder() + "/PathFindMetric/" + transform.GetComponent <LoadSystemBoundary>().GetCurrentMazeNameWithoutExtensions() + "_" + pathFindAlgorithms.ToString() + "_PathFindMetric.txt";
        }
        catch (System.IndexOutOfRangeException)
        {
            currentMazeDirectory = string.Empty;
        }

        saveSystem = new SaveSystemFactory().CreateSaveSystemForPathFindProcessMetric(
            currentMazeDirectory,
            defaultSaveFolderPath,
            pathFindProcessMetric);

        saveSystem.Save();
    }
 public AnalyticPathFindMetricFormat(List <string> _saveText, IPathFindProcessMetricCollector _pathFindProcessMetricCollector)
 {
     saveText = _saveText;
     pathFindProcessMetricCollector = _pathFindProcessMetricCollector;
 }
示例#5
0
 public PathFindProcessMetricSaveTextCreator(IPathFindProcessMetricCollector _pathFindProcessMetricCollector, List <string> _saveText, IAnalyticMetricFormat _analyticPathFindMetricFormat)
 {
     pathFindProcessMetricCollector = _pathFindProcessMetricCollector;
     analyticPathFindMetricFormat   = _analyticPathFindMetricFormat;
     saveText = _saveText;
 }