From 3357050d7341492cd17e3bc6d331401903fd3453 Mon Sep 17 00:00:00 2001 From: Eronan Date: Mon, 12 Sep 2022 22:50:07 +1000 Subject: [PATCH] Code Cleanup --- AddDownloadURLs/Program.cs | 4 ++-- ConvertLackeyCCGFileToJSON/Program.cs | 5 +--- FECipher/FEAlternateArts.cs | 1 - FECipher/FECard.cs | 8 +------ FECipher/FECardList.cs | 3 +-- FECipher/FECipher.cs | 6 ----- FECipher/FECipher.csproj | 4 ---- FECipher/FEDeckBuildingMethods.cs | 33 ++++++++++++--------------- FECipher/FEDownloader.cs | 5 ---- FECipher/FEFormats.cs | 2 -- 10 files changed, 19 insertions(+), 52 deletions(-) diff --git a/AddDownloadURLs/Program.cs b/AddDownloadURLs/Program.cs index 8cd6e61..08563fe 100644 --- a/AddDownloadURLs/Program.cs +++ b/AddDownloadURLs/Program.cs @@ -1,12 +1,12 @@ // See https://aka.ms/new-console-template for more information -using System.Text.Json; using FECipher; +using System.Text.Json; const string jsonCardList = @"D:\Ernest's Folder\GitUpdate Repos\Multi-TCG Deck Builder Projects\Multi-TCG-Deckbuilder\Multi-TCG-Deckbuilder\bin\Debug\net6.0-windows\plug-ins\fe-cipher\cardlist.json"; const string imageDownloadURLs = @"D:\Ernest's Folder\Desktop Folders\Nothing Important\LackeyCCG\plugins\FECipher0\CardImageURLs3.txt"; Dictionary downloadURLs = new Dictionary(); -foreach(string line in File.ReadAllLines(imageDownloadURLs)) +foreach (string line in File.ReadAllLines(imageDownloadURLs)) { string[] items = line.Split('\t'); string id = Path.GetFileNameWithoutExtension(items[0]); diff --git a/ConvertLackeyCCGFileToJSON/Program.cs b/ConvertLackeyCCGFileToJSON/Program.cs index be5e0fe..0b139c1 100644 --- a/ConvertLackeyCCGFileToJSON/Program.cs +++ b/ConvertLackeyCCGFileToJSON/Program.cs @@ -1,7 +1,4 @@ -using System.IO; -using System.Text.Json; -using System.Text.RegularExpressions; -using FECipher; +using FECipher; // See https://aka.ms/new-console-template for more information const string lackeyCCGFile = @"D:\Ernest's Folder\Desktop Folders\Nothing Important\LackeyCCG\plugins\FECipher0\sets\official-cards.txt"; diff --git a/FECipher/FEAlternateArts.cs b/FECipher/FEAlternateArts.cs index a9ef323..596721e 100644 --- a/FECipher/FEAlternateArts.cs +++ b/FECipher/FEAlternateArts.cs @@ -1,5 +1,4 @@ using System.Text.Json.Serialization; -using IGamePlugInBase; namespace FECipher { diff --git a/FECipher/FECard.cs b/FECipher/FECard.cs index 5d4e396..8bb551a 100644 --- a/FECipher/FECard.cs +++ b/FECipher/FECard.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Text.Json.Serialization; -using System.Threading.Tasks; -using IGamePlugInBase; +using System.Text.Json.Serialization; namespace FECipher { diff --git a/FECipher/FECardList.cs b/FECipher/FECardList.cs index 96f7ba3..fdf6fbf 100644 --- a/FECipher/FECardList.cs +++ b/FECipher/FECardList.cs @@ -1,5 +1,4 @@ -using System.Runtime.CompilerServices; -using System.Text.Json; +using System.Text.Json; namespace FECipher { diff --git a/FECipher/FECipher.cs b/FECipher/FECipher.cs index 7b1cf49..a83cf6a 100644 --- a/FECipher/FECipher.cs +++ b/FECipher/FECipher.cs @@ -1,12 +1,6 @@ using IGamePlugInBase; using IGamePlugInBase.IO; -using Octokit; -using System; -using System.IO; -using System.Net; -using System.Net.Http; using System.Reflection; -using System.Text.Json; namespace FECipher { diff --git a/FECipher/FECipher.csproj b/FECipher/FECipher.csproj index 6a1ee06..381e032 100644 --- a/FECipher/FECipher.csproj +++ b/FECipher/FECipher.csproj @@ -9,10 +9,6 @@ 1.0.0.0 - - - - diff --git a/FECipher/FEDeckBuildingMethods.cs b/FECipher/FEDeckBuildingMethods.cs index ba6e11e..455d635 100644 --- a/FECipher/FEDeckBuildingMethods.cs +++ b/FECipher/FEDeckBuildingMethods.cs @@ -1,10 +1,5 @@ using IGamePlugInBase; using IGamePlugInBase.IO; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace FECipher { @@ -305,22 +300,22 @@ public string GetDetailedStats(Dictionary> } } - string textFormat = "Deck Size: {0}\tMain Characters: {1} ({2}%)\n" + - "0 Support: {3} ({4}%)\tNo Range: {11} ({12}%)\n" + - "10 Support: {5} ({6}%)\tRange 1: {13} ({14}%)\n" + - "20 Support: {7} ({8}%)\tRange 2: {15} ({16}%)\n" + - "30 Support: {9} ({10}%)\tRange 3: {17} ({17}%)\n"; + string textFormat = "Deck Size: {0}\t\tMain Characters: {1} ({2}%)\n" + + "0 Support: {3} ({4}%)" + (support0 >= 100 ? "\t" : "\t\t") + "No Range: {11} ({12}%)\n" + + "10 Support: {5} ({6}%)" + (support10 >= 10 ? "\t" : "\t\t") + "Range 1: {13} ({14}%)\n" + + "20 Support: {7} ({8}%)" + (support20 >= 10 ? "\t" : "\t\t") + "Range 2: {15} ({16}%)\n" + + "30 Support: {9} ({10}%)" + (support30 >= 10 ? "\t" : "\t\t") + "Range 3: {17} ({17}%)\n"; return string.Format(textFormat, deckSize, - mainCharacterNames, mainCharacterNames / deckSize * 100, - support0, support0 / deckSize * 100, - support10, support10 / deckSize * 100, - support20, support20 / deckSize * 100, - support30, support30 / deckSize * 100, - range0, range0 / deckSize * 100, - range1, range1 / deckSize * 100, - range2, range2 / deckSize * 100, - range3, range3 / deckSize * 100); + mainCharacterNames, Math.Round(((double)mainCharacterNames / (double)deckSize) * 100, 0), + support0, Math.Round(((double)support0 / (double)deckSize) * 100, 0), + support10, Math.Round(((double)support10 / (double)deckSize) * 100, 0), + support20, Math.Round(((double)support20 / (double)deckSize) * 100, 0), + support30, Math.Round(((double)support30 / (double)deckSize) * 100, 0), + range0, Math.Round(((double)range0 / (double)deckSize) * 100, 0), + range1, Math.Round(((double)range1 / (double)deckSize) * 100, 0), + range2, Math.Round(((double)range2 / (double)deckSize) * 100, 0), + range3, Math.Round(((double)range3 / (double)deckSize) * 100, 0)); } /// diff --git a/FECipher/FEDownloader.cs b/FECipher/FEDownloader.cs index d50a39b..77165f8 100644 --- a/FECipher/FEDownloader.cs +++ b/FECipher/FEDownloader.cs @@ -1,9 +1,4 @@ using IGamePlugInBase.IO; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace FECipher { diff --git a/FECipher/FEFormats.cs b/FECipher/FEFormats.cs index cc79673..6ead29a 100644 --- a/FECipher/FEFormats.cs +++ b/FECipher/FEFormats.cs @@ -1,6 +1,4 @@ using IGamePlugInBase; -using IGamePlugInBase.IO; -using System.Linq; namespace FECipher {