示例#1
0
 /// <summary>
 /// Logs info about a given character.
 /// </summary>
 /// <param name="name">Character name</param>
 /// <param name="charData">Data to be logged</param>
 /// <param name="displayFlag">Whether to display or just log to file</param>
 private void _DisplayCharData(string name, GameLogger.CharData_t charData, bool displayFlag)
 {
     LogManager logManager = LogManager.MainObj();
     if (logManager == null)
         return;
     if (displayFlag)
     {
         logManager.appendLog("");
         logManager.appendLog("◆" + name + "'s battle record ---");
         logManager.appendLog("Total matches = " + (object)charData.GetTotalGames());
         logManager.appendLog("Wins=" + charData.winGames.ToString() + ",");
         logManager.append("Losses=" + charData.loseGames.ToString() + ",");
         logManager.append("Draws=" + charData.drawGames.ToString() + ",");
         logManager.append("Errors=" + charData.errorGames.ToString() + ",");
         logManager.append("Cancelled matches=" + charData.canceledGames.ToString());
         logManager.appendLog("Total number of rounds = " + (object)charData.GetTotalRounds());
         logManager.appendLog("Wins=" + charData.winRounds.ToString());
         logManager.append("(KO=" + charData.winKORounds.ToString() + "),");
         logManager.append("Losses=" + charData.loseRounds.ToString());
         logManager.append("(KO=" + charData.loseKORounds.ToString() + "),");
         logManager.append("Draws=" + charData.drawRounds.ToString() + ",");
         logManager.append("Errors=" + charData.errorRounds.ToString() + ",");
         logManager.append("Cancelled matches=" + charData.canceledRounds.ToString());
     }
     else
     {
         logManager._appendLog("");
         logManager._appendLog("◆" + name + "'s battle record ---");
         logManager._appendLog("Total matches = " + (object)charData.GetTotalGames());
         logManager._appendLog("Wins=" + charData.winGames.ToString() + ",");
         logManager._append("Losses=" + charData.loseGames.ToString() + ",");
         logManager._append("Draws=" + charData.drawGames.ToString() + ",");
         logManager._append("Errorsー=" + charData.errorGames.ToString() + ",");
         logManager._append("Cancelled matches=" + charData.canceledGames.ToString());
         logManager._appendLog("Total number of rounds = " + (object)charData.GetTotalRounds());
         logManager._appendLog("Wins=" + charData.winRounds.ToString());
         logManager._append("(KO=" + charData.winKORounds.ToString() + "),");
         logManager._append("Losses=" + charData.loseRounds.ToString());
         logManager._append("(KO=" + charData.loseKORounds.ToString() + "),");
         logManager._append("Draws=" + charData.drawRounds.ToString() + ",");
         logManager._append("Errors=" + charData.errorRounds.ToString() + ",");
         logManager._append("Cancelled matches=" + charData.canceledRounds.ToString());
     }
 }
示例#2
0
 public void SaveAll(string fileName)
 {
     switch (fileName)
     {
         case "":
             break;
         default:
             LogManager logManager = LogManager.MainObj();
             if (logManager == null)
                 break;
             string contents = "--- Battle record log ---" + Environment.NewLine + Environment.NewLine;
             List<string> stringList = new List<string>();
             foreach (DictionaryEntry dictionaryEntry in this.charDataBase)
                 stringList.Add((string)dictionaryEntry.Key);
             stringList.Sort();
             foreach (string str in stringList)
             {
                 GameLogger.CharData_t charDataT = (GameLogger.CharData_t)this.charDataBase[(object)str];
                 contents = contents + "◆" + str + "'s battle record ---";
                 contents += Environment.NewLine;
                 contents = contents + "Total matches = " + (object)charDataT.GetTotalGames();
                 contents += Environment.NewLine;
                 contents = contents + "Wins=" + charDataT.winGames.ToString() + ",";
                 contents = contents + "Losses=" + charDataT.loseGames.ToString() + ",";
                 contents = contents + "Draws=" + charDataT.drawGames.ToString() + ",";
                 contents = contents + "Error=" + charDataT.errorGames.ToString() + ",";
                 contents = contents + "Cancelled matches=" + charDataT.canceledGames.ToString();
                 contents += Environment.NewLine;
                 contents = contents + "Total number of rounds = " + (object)charDataT.GetTotalRounds();
                 contents += Environment.NewLine;
                 contents = contents + "Wins=" + charDataT.winRounds.ToString();
                 contents = contents + "(KO=" + charDataT.winKORounds.ToString() + "),";
                 contents = contents + "Losses=" + charDataT.loseRounds.ToString();
                 contents = contents + "(KO=" + charDataT.loseKORounds.ToString() + "),";
                 contents = contents + "Draws=" + charDataT.drawRounds.ToString() + ",";
                 contents = contents + "Errors=" + charDataT.errorRounds.ToString() + ",";
                 contents = contents + "Cancelled matches=" + charDataT.canceledRounds.ToString();
                 contents += Environment.NewLine;
                 contents += Environment.NewLine;
             }
             Encoding encoding = Encoding.GetEncoding("SHIFT_JIS");
             try
             {
                 File.AppendAllText(fileName, contents, encoding);
                 logManager.appendLog("The battle history log has been saved to the " + fileName + " file");
                 break;
             }
             catch
             {
                 int num = (int)MessageBox.Show("Could not save the battle history to the " + fileName + " log file", "Swiss Army Knife");
                 break;
             }
     }
 }
示例#3
0
 public void CopyAll(string fileName)
 {
     switch (fileName)
     {
         case "":
             break;
         default:
             LogManager logManager = LogManager.MainObj();
             if (logManager == null)
                 break;
             string contents = "Name, Total maches, Wins, Losses, Draws, Errors, Cancelled maches, Total rounds, Wins, KO wins, Losses, KO losses, Draws, Errors, Cancelled rounds" + Environment.NewLine;
             List<string> stringList = new List<string>();
             foreach (DictionaryEntry dictionaryEntry in this.charDataBase)
                 stringList.Add((string)dictionaryEntry.Key);
             stringList.Sort();
             foreach (string str in stringList)
             {
                 GameLogger.CharData_t charDataT = (GameLogger.CharData_t)this.charDataBase[(object)str];
                 contents = contents + str + ", ";
                 contents = contents + (object)charDataT.GetTotalGames() + ", ";
                 contents = contents + (object)charDataT.winGames + ", ";
                 contents = contents + (object)charDataT.loseGames + ", ";
                 contents = contents + (object)charDataT.drawGames + ", ";
                 contents = contents + (object)charDataT.errorGames + ", ";
                 contents = contents + (object)charDataT.canceledGames + ", ";
                 contents = contents + (object)charDataT.GetTotalRounds() + ", ";
                 contents = contents + (object)charDataT.winRounds + ", ";
                 contents = contents + (object)charDataT.winKORounds + ", ";
                 contents = contents + (object)charDataT.loseRounds + ", ";
                 contents = contents + (object)charDataT.loseKORounds + ", ";
                 contents = contents + (object)charDataT.drawRounds + ", ";
                 contents = contents + (object)charDataT.errorRounds + ", ";
                 contents += (string)(object)charDataT.canceledRounds;
                 contents += Environment.NewLine;
             }
             Encoding encoding = Encoding.GetEncoding("SHIFT_JIS");
             try
             {
                 File.AppendAllText(fileName, contents, encoding);
                 logManager.appendLog("The battle history log has been saved to the " + fileName + " file");
                 break;
             }
             catch
             {
                 int num = (int)MessageBox.Show("Could not save the battle history to the " + fileName + " log file", "Swiss Army Knife");
                 break;
             }
     }
 }