public void WriteResult(string dir)
    {
        string fileName = "";

        if (_mode == MachineTestAnalysisMode.User)
        {
            int userId = _userResult.UserIndex + 1;
            fileName = dir + "analysis_" + _userResult.Machine.Name + "_" + userId.ToString() + ".txt";
        }
        else if (_mode == MachineTestAnalysisMode.Machine)
        {
            fileName = dir + "analysis_" + _machineResult.MachineName + ".txt";
        }
        else
        {
            Debug.Assert(false);
        }

        _streamWriter = FileStreamUtility.CreateFileStream(fileName);

        WriteConfig();
        WriteContent();

        FileStreamUtility.CloseFile(_streamWriter);
    }
Esempio n. 2
0
    public void WriteResult(string dir, MachineTestPrintFileNameMode mode)
    {
        string postfix = "";

        if (mode == MachineTestPrintFileNameMode.UserId)
        {
            int userId = _userResult.UserIndex + 1;
            postfix = userId.ToString();
        }
        else if (mode == MachineTestPrintFileNameMode.Seed)
        {
            postfix = _userResult.StartSeed.ToString();
        }
        else
        {
            Debug.Assert(false);
        }

        string fileName = dir + _userResult.Machine.Name + "_" + postfix + ".csv";

        _streamWriter = FileStreamUtility.CreateFileStream(fileName);

        WriteHeader();
        WriteContent();

        FileStreamUtility.CloseFile(_streamWriter);
    }
    void OutputMachineSeeds(MachineSeedGenConfig genConfig, List <uint> seedList)
    {
        if (genConfig._isOutputSeeds)
        {
            string[] seedArray = new string[seedList.Count];
            for (int i = 0; i < seedList.Count; i++)
            {
                seedArray[i] = seedList[i].ToString();
            }

            string content = string.Join(MachineSeedConfig.SeedFileDelimitor.ToString(), seedArray);

            string fileName = MachineSeedConfig.GetSeedFileName(genConfig._machineName, true);
            string filePath = Path.Combine(_outputSeedsDir, fileName);

            FileStreamUtility.DeleteFile(filePath);
            StreamWriter writer = FileStreamUtility.CreateFileStream(filePath);
            FileStreamUtility.WriteFile(writer, content);
            FileStreamUtility.CloseFile(writer);
        }
    }
Esempio n. 4
0
    void PrintData(List <MultiLineExportData> dataList)
    {
        if (File.Exists(_exportDataFilePath))
        {
            File.Delete(_exportDataFilePath);
        }

        StreamWriter writer = FileStreamUtility.CreateFileStream(_exportDataFilePath);

        FileStreamUtility.WriteFile(writer, "PayoutReward,NearHitReward,Reel1,Reel2,Reel3");

        for (int i = 0; i < dataList.Count; i++)
        {
            MultiLineExportData data = dataList[i];
            string s = string.Format("{0},{1},{2},{3},{4}", data._payoutReward, data._nearHitReward,
                                     data._stopIndexes[0], data._stopIndexes[1], data._stopIndexes[2]);

            FileStreamUtility.WriteFile(writer, s);
        }

        FileStreamUtility.CloseFile(writer);
    }