diff --git a/NetrunnerdbToJinteki.sln b/NetrunnerdbToJinteki.sln new file mode 100644 index 0000000..ac311bc --- /dev/null +++ b/NetrunnerdbToJinteki.sln @@ -0,0 +1,22 @@ + +Microsoft Visual Studio Solution File, Format Version 12.00 +# Visual Studio 14 +VisualStudioVersion = 14.0.24720.0 +MinimumVisualStudioVersion = 10.0.40219.1 +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NetrunnerdbToJinteki", "NetrunnerdbToJinteki\NetrunnerdbToJinteki.csproj", "{006CE31F-57E4-4016-BCF7-7FCA2766F547}" +EndProject +Global + GlobalSection(SolutionConfigurationPlatforms) = preSolution + Debug|Any CPU = Debug|Any CPU + Release|Any CPU = Release|Any CPU + EndGlobalSection + GlobalSection(ProjectConfigurationPlatforms) = postSolution + {006CE31F-57E4-4016-BCF7-7FCA2766F547}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {006CE31F-57E4-4016-BCF7-7FCA2766F547}.Debug|Any CPU.Build.0 = Debug|Any CPU + {006CE31F-57E4-4016-BCF7-7FCA2766F547}.Release|Any CPU.ActiveCfg = Release|Any CPU + {006CE31F-57E4-4016-BCF7-7FCA2766F547}.Release|Any CPU.Build.0 = Release|Any CPU + EndGlobalSection + GlobalSection(SolutionProperties) = preSolution + HideSolutionNode = FALSE + EndGlobalSection +EndGlobal diff --git a/Readme.md b/Readme.md new file mode 100644 index 0000000..37f94d3 --- /dev/null +++ b/Readme.md @@ -0,0 +1,9 @@ +This is a simple program that constructs a decklist in your clipboard that jinteki.net tolerates (windows only sorry!) + + +Build the program. +Then call jinteki.exe IdOfNetrunnerDbDeck + +You can find the id in the url of a decklist + +for example http://netrunnerdb.com/en/decklist/30658/sea-scorched-earth-advisers-inc is a valid url the numbers after decklist but before sea-scorched is a valid id so in this case its 30658 diff --git a/src/NetrunnerdbToJinteki/App.config b/src/NetrunnerdbToJinteki/App.config new file mode 100644 index 0000000..8e15646 --- /dev/null +++ b/src/NetrunnerdbToJinteki/App.config @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/src/NetrunnerdbToJinteki/NetrunnerdbToJinteki.csproj b/src/NetrunnerdbToJinteki/NetrunnerdbToJinteki.csproj new file mode 100644 index 0000000..b4d8dcd --- /dev/null +++ b/src/NetrunnerdbToJinteki/NetrunnerdbToJinteki.csproj @@ -0,0 +1,104 @@ + + + + + Debug + AnyCPU + {006CE31F-57E4-4016-BCF7-7FCA2766F547} + Exe + Properties + NetrunnerdbToJinteki + jinteki + v4.5 + 512 + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + AnyCPU + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + AnyCPU + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + + ..\packages\LinqRb.1.2.0\lib\net45\LinqRb.dll + True + + + ..\packages\NetrunnerDb.Net.1.1.17.0\lib\net45\NetrunnerDb.Net.dll + True + + + ..\packages\Newtonsoft.Json.6.0.8\lib\net45\Newtonsoft.Json.dll + True + + + ..\packages\RestSharp.105.1.0\lib\net45\RestSharp.dll + True + + + + + + + + + + + + + + + + + + + + + + False + Microsoft .NET Framework 4.5 %28x86 and x64%29 + true + + + False + .NET Framework 3.5 SP1 + false + + + + + \ No newline at end of file diff --git a/src/NetrunnerdbToJinteki/Program.cs b/src/NetrunnerdbToJinteki/Program.cs new file mode 100644 index 0000000..9206a85 --- /dev/null +++ b/src/NetrunnerdbToJinteki/Program.cs @@ -0,0 +1,33 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; +using System.Threading.Tasks; +using System.Windows.Forms; +using NetrunnerDb.Net; + +namespace NetrunnerdbToJinteki +{ + public class Program + { + [STAThread()] + public static void Main(string[] args) + { + if(args.Length < 1) + { + Console.WriteLine("Input id of decklist"); + Environment.Exit(1); + } + var stringBuilder = new StringBuilder(); + new Repository() + .GetDecklist(args[0]) + .First() + .Cards + .Select(a => new { Card = new Repository().GetCard(a.Key).First(), Count = a.Value }) + .Where(a => !string.Equals(a.Card.Type, "Identity", StringComparison.OrdinalIgnoreCase)) + .ForEach(a => stringBuilder.AppendLine($"{a.Count} {a.Card.Title}")); + + Clipboard.SetText(stringBuilder.ToString()); + } + } +} \ No newline at end of file diff --git a/src/NetrunnerdbToJinteki/Properties/AssemblyInfo.cs b/src/NetrunnerdbToJinteki/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..bd8fba6 --- /dev/null +++ b/src/NetrunnerdbToJinteki/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("NetrunnerdbToJinteki")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Microsoft")] +[assembly: AssemblyProduct("NetrunnerdbToJinteki")] +[assembly: AssemblyCopyright("Copyright © Microsoft 2016")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("006ce31f-57e4-4016-bcf7-7fca2766f547")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/src/NetrunnerdbToJinteki/packages.config b/src/NetrunnerdbToJinteki/packages.config new file mode 100644 index 0000000..63ba522 --- /dev/null +++ b/src/NetrunnerdbToJinteki/packages.config @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file