Skip to content

Commit

Permalink
Code Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
Eronan committed Sep 12, 2022
1 parent 0ebfae3 commit 3357050
Show file tree
Hide file tree
Showing 10 changed files with 19 additions and 52 deletions.
4 changes: 2 additions & 2 deletions AddDownloadURLs/Program.cs
Original file line number Diff line number Diff line change
@@ -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<string, string> downloadURLs = new Dictionary<string, string>();
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]);
Expand Down
5 changes: 1 addition & 4 deletions ConvertLackeyCCGFileToJSON/Program.cs
Original file line number Diff line number Diff line change
@@ -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";
Expand Down
1 change: 0 additions & 1 deletion FECipher/FEAlternateArts.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Text.Json.Serialization;
using IGamePlugInBase;

namespace FECipher
{
Expand Down
8 changes: 1 addition & 7 deletions FECipher/FECard.cs
Original file line number Diff line number Diff line change
@@ -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
{
Expand Down
3 changes: 1 addition & 2 deletions FECipher/FECardList.cs
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
using System.Runtime.CompilerServices;
using System.Text.Json;
using System.Text.Json;

namespace FECipher
{
Expand Down
6 changes: 0 additions & 6 deletions FECipher/FECipher.cs
Original file line number Diff line number Diff line change
@@ -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
{
Expand Down
4 changes: 0 additions & 4 deletions FECipher/FECipher.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@
<FileVersion>1.0.0.0</FileVersion>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Octokit" Version="2.0.1" />
</ItemGroup>

<ItemGroup>
<ProjectReference Include="..\..\Multi-TCG-Deckbuilder\IGamePlugInBase\IGamePlugInBase.csproj" />
</ItemGroup>
Expand Down
33 changes: 14 additions & 19 deletions FECipher/FEDeckBuildingMethods.cs
Original file line number Diff line number Diff line change
@@ -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
{
Expand Down Expand Up @@ -305,22 +300,22 @@ public string GetDetailedStats(Dictionary<string, IEnumerable<DeckBuilderCard>>
}
}

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));
}

/// <summary>
Expand Down
5 changes: 0 additions & 5 deletions FECipher/FEDownloader.cs
Original file line number Diff line number Diff line change
@@ -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
{
Expand Down
2 changes: 0 additions & 2 deletions FECipher/FEFormats.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
using IGamePlugInBase;
using IGamePlugInBase.IO;
using System.Linq;

namespace FECipher
{
Expand Down

0 comments on commit 3357050

Please sign in to comment.