Пример #1
0
    private void WriteHeader()
    {
        string reelStr    = "";
        string isFixedStr = "";

        if (_userResult.Machine.MachineConfig.BasicConfig.ReelCount == CoreDefine.Reel3)
        {
            reelStr    = "Reel1,Reel2,Reel3,";
            isFixedStr = "IsFixed1,IsFixed2,IsFixed3,";
        }
        else if (_userResult.Machine.MachineConfig.BasicConfig.ReelCount == CoreDefine.Reel4)
        {
            reelStr    = "Reel1,Reel2,Reel3,Reel4,";
            isFixedStr = "IsFixed1,IsFixed2,IsFixed3,IsFixed4,";
        }
        else if (_userResult.Machine.MachineConfig.BasicConfig.ReelCount == CoreDefine.Reel5)
        {
            reelStr    = "Reel1,Reel2,Reel3,Reel4,Reel5,";
            isFixedStr = "IsFixed1,IsFixed2,IsFixed3,IsFixed4,IsFixed5,";
        }
        else
        {
            Debug.Assert(false);
        }

        string s = "ID," + reelStr + "ResultType,ResultId,Lucky,CurrentCredit," +
                   "Bet,Amount,CreditChange,RemainCredit,LuckyChange,RemainLucky,IsRespin,"
                   + isFixedStr + "IsTriggerIndieGame,IndieGameWinAmount,IndieGameCustomData";

        FileStreamUtility.WriteFile(_streamWriter, s);
    }
Пример #2
0
 private void WriteContent()
 {
     for (int i = 0; i < _userResult.RoundResults.Count; i++)
     {
         int id = i + 1;
         MachineTestRoundResult roundResult = _userResult.RoundResults[i];
         string s = ConstructResult(id, roundResult._input, roundResult._output);
         FileStreamUtility.WriteFile(_streamWriter, s);
     }
 }
Пример #3
0
    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);
        }
    }
Пример #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);
    }
 private void Write(string s)
 {
     FileStreamUtility.WriteFile(_streamWriter, s);
 }