Skip to content

Commit

Permalink
Split projects into seperate repositories.
Browse files Browse the repository at this point in the history
  • Loading branch information
Latency committed Feb 4, 2018
1 parent 2c97d5f commit d194fc7
Show file tree
Hide file tree
Showing 35 changed files with 188 additions and 138 deletions.

This file was deleted.

35 changes: 0 additions & 35 deletions HearthDb.CardIdGenerator/Program.cs

This file was deleted.

22 changes: 0 additions & 22 deletions HearthDb.EnumsGenerator/HearthStone.Database.EnumsGenerator.csproj

This file was deleted.

32 changes: 32 additions & 0 deletions HearthStone.Database.CardIdGenerator.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27130.2027
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HearthStone Database CardIdGenerator", "HearthStone.Database.CardIdGenerator\HearthStone.Database.CardIdGenerator.csproj", "{963D32A8-D3D9-46F5-A25A-13642C7587AE}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{F0CF94A4-F850-4166-9836-581BC23EE7B9}"
ProjectSection(SolutionItems) = preProject
.gitignore = .gitignore
LICENSE = LICENSE
README.md = README.md
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{963D32A8-D3D9-46F5-A25A-13642C7587AE}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{963D32A8-D3D9-46F5-A25A-13642C7587AE}.Debug|Any CPU.Build.0 = Debug|Any CPU
{963D32A8-D3D9-46F5-A25A-13642C7587AE}.Release|Any CPU.ActiveCfg = Release|Any CPU
{963D32A8-D3D9-46F5-A25A-13642C7587AE}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {F2DA2721-9AA4-4709-9E8C-B143D10B40D1}
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
namespace HearthDb.CardIdGenerator
namespace HearthStone.Database.CardIdGenerator
{
public enum CardSet
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net471</TargetFrameworks>
<OutputType>Exe</OutputType>
<StartupObject>HearthStone.Database.CardIdGenerator.Program</StartupObject>
<RootNamespace>HearthStone.Database.CardIdGenerator</RootNamespace>
<AssemblyName>HearthStone.Database.CardIdGenerator</AssemblyName>
<Version>2.0.0</Version>
<Description>HearthStone Database Card ID Generator</Description>
<PackageTags>HearthStone Database Card ID Generator</PackageTags>
<PackageReleaseNotes>Upgraded build configurations.</PackageReleaseNotes>
<RepositoryType>GIT</RepositoryType>
<RepositoryUrl>https://github.com/Latency/HearthStone.Database</RepositoryUrl>
<Copyright>Copyright © HearthSim</Copyright>
<PackageLicenseUrl>https://opensource.org/licenses/MIT</PackageLicenseUrl>
<Company>HearthSim</Company>
<Authors>HearthSim</Authors>
<PackageIconUrl>https://raw.githubusercontent.com/HearthSim/Hearthstone-Deck-Tracker/master/Hearthstone%20Deck%20Tracker/Images/HearthstoneDeckTracker.ico</PackageIconUrl>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="HearthStone.Database" Version="10.0.1" />
<PackageReference Include="Microsoft.CodeAnalysis" Version="2.6.1" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="2.6.1" />
</ItemGroup>

</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,10 @@
using System.Collections.Generic;
using System.Globalization;
using System.Text.RegularExpressions;
using static HearthDb.Enums.CardSet;

#endregion

namespace HearthDb.CardIdGenerator
namespace HearthStone.Database.CardIdGenerator
{
internal class Helper
{
Expand Down Expand Up @@ -89,43 +88,43 @@ internal static string GetSetName(CardSet set)
}
}

public static string GetSetAbbreviation(Enums.CardSet set)
public static string GetSetAbbreviation(HearthDb.Enums.CardSet set)
{
switch(set)
{
case FP1:
case HearthDb.Enums.CardSet.FP1:
return "NAXX";
case PE1:
case HearthDb.Enums.CardSet.PE1:
return "GVG";
case EXPERT1:
case HearthDb.Enums.CardSet.EXPERT1:
return "Classic";
case MISSIONS:
case HearthDb.Enums.CardSet.MISSIONS:
return "Missions";
case CORE:
case HearthDb.Enums.CardSet.CORE:
return "Basic";
case INVALID:
case HearthDb.Enums.CardSet.INVALID:
return "Invalid";
case TEST_TEMPORARY:
case HearthDb.Enums.CardSet.TEST_TEMPORARY:
return "Test";
case DEMO:
case HearthDb.Enums.CardSet.DEMO:
return "Demo";
case NONE:
case HearthDb.Enums.CardSet.NONE:
return "None";
case CHEAT:
case HearthDb.Enums.CardSet.CHEAT:
return "Cheat";
case BLANK:
case HearthDb.Enums.CardSet.BLANK:
return "Blank";
case DEBUG_SP:
case HearthDb.Enums.CardSet.DEBUG_SP:
return "Debug";
case PROMO:
case HearthDb.Enums.CardSet.PROMO:
return "Promo";
case CREDITS:
case HearthDb.Enums.CardSet.CREDITS:
return "Credits";
case HERO_SKINS:
case HearthDb.Enums.CardSet.HERO_SKINS:
return "HeroSkins";
case TB:
case HearthDb.Enums.CardSet.TB:
return "TavernBrawl";
case SLUSH:
case HearthDb.Enums.CardSet.SLUSH:
return "Slush";
default:
return set.ToString();
Expand Down
34 changes: 34 additions & 0 deletions HearthStone.Database.CardIdGenerator/Program.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#region

using System.IO;
using Microsoft.CodeAnalysis;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.Formatting;
using Microsoft.CodeAnalysis.MSBuild;

#endregion

namespace HearthStone.Database.CardIdGenerator
{
internal class Program
{
private const string File = "../../../../HearthStone.Database/CardIds.cs";

static void Main()
{
var @namespace = SyntaxFactory.NamespaceDeclaration(SyntaxFactory.IdentifierName("HearthDb"));
var header = SyntaxFactory.ParseLeadingTrivia(@"/* THIS CLASS WAS GENERATED BY HearthDb.CardIdGenerator. DO NOT EDIT. */");
var cCardIds = SyntaxFactory.ClassDeclaration("CardIds").AddModifiers(SyntaxFactory.Token(SyntaxKind.PublicKeyword)).WithLeadingTrivia(header);
var cCollectible = SyntaxFactory.ClassDeclaration("Collectible").AddModifiers(SyntaxFactory.Token(SyntaxKind.PublicKeyword));
cCollectible = SyntaxBuilder.GetCollectible(cCollectible);
var cNonCollectible = SyntaxBuilder.GetNonCollectible();

cCardIds = cCardIds.AddMembers(cCollectible);
cCardIds = cCardIds.AddMembers(cNonCollectible);
@namespace = @namespace.AddMembers(cCardIds);
var root = Formatter.Format(@namespace, MSBuildWorkspace.Create());
using(var sr = new StreamWriter(File))
sr.Write(root.ToString());
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@
using System.Globalization;
using System.Linq;
using System.Text.RegularExpressions;
using HearthDb;
using HearthDb.Enums;
using Microsoft.CodeAnalysis.CSharp;
using Microsoft.CodeAnalysis.CSharp.Syntax;
using static Microsoft.CodeAnalysis.CSharp.SyntaxFactory;
using static Microsoft.CodeAnalysis.CSharp.SyntaxKind;

#endregion

namespace HearthDb.CardIdGenerator
namespace HearthStone.Database.CardIdGenerator
{
internal class SyntaxBuilder
{
Expand All @@ -23,11 +23,11 @@ internal static ClassDeclarationSyntax GetNonCollectible()
while(true)
{
var newNamingConflicts = new Dictionary<string, List<string>>();
var classDecl = ClassDeclaration("NonCollectible").AddModifiers(Token(PublicKeyword));
var classDecl = SyntaxFactory.ClassDeclaration("NonCollectible").AddModifiers(SyntaxFactory.Token(SyntaxKind.PublicKeyword));
foreach(var c in ClassNames)
{
var className = c == "DREAM" ? "DreamCards" : CultureInfo.InvariantCulture.TextInfo.ToTitleCase(c.ToLower());
var cCard = ClassDeclaration(className).AddModifiers(Token(PublicKeyword));
var cCard = SyntaxFactory.ClassDeclaration(className).AddModifiers(SyntaxFactory.Token(SyntaxKind.PublicKeyword));
var anyCards = false;
foreach(var card in
Cards.All.OrderBy(x => x.Value.Set)
Expand Down Expand Up @@ -72,7 +72,7 @@ private static string ResolveNameFromId(Card card, string name)
name = tmpName + "_" + name;
}
}
if(card.Set == Enums.CardSet.HERO_SKINS)
if(card.Set == HearthDb.Enums.CardSet.HERO_SKINS)
name += "HeroSkins";
if(Regex.IsMatch(card.Id, @"_\d+[abhHt]?[eo]"))
name += "Enchantment";
Expand Down Expand Up @@ -129,7 +129,7 @@ internal static ClassDeclarationSyntax GetCollectible(ClassDeclarationSyntax cla
{
var anyCards = false;
var className = CultureInfo.InvariantCulture.TextInfo.ToTitleCase(c.ToLower());
var cCard = ClassDeclaration(className).AddModifiers(Token(PublicKeyword));
var cCard = SyntaxFactory.ClassDeclaration(className).AddModifiers(SyntaxFactory.Token(SyntaxKind.PublicKeyword));
foreach(var card in
Cards.All.Values.Where(x => x.Collectible && x.Class.ToString().Equals(c)))
{
Expand All @@ -149,12 +149,12 @@ private static IEnumerable<string> ClassNames

internal static FieldDeclarationSyntax GenerateConst(string identifier, string value)
{
var assignedValue = EqualsValueClause(LiteralExpression(StringLiteralExpression, Literal(value)));
var declaration = SeparatedList(new[] {VariableDeclarator(Identifier(identifier), null, assignedValue)});
var assignedValue = SyntaxFactory.EqualsValueClause(SyntaxFactory.LiteralExpression(SyntaxKind.StringLiteralExpression, SyntaxFactory.Literal(value)));
var declaration = SyntaxFactory.SeparatedList(new[] {SyntaxFactory.VariableDeclarator(SyntaxFactory.Identifier(identifier), null, assignedValue)});
return
FieldDeclaration(VariableDeclaration(ParseTypeName("string"), declaration))
.AddModifiers(Token(PublicKeyword))
.AddModifiers(Token(ConstKeyword));
SyntaxFactory.FieldDeclaration(SyntaxFactory.VariableDeclaration(SyntaxFactory.ParseTypeName("string"), declaration))
.AddModifiers(SyntaxFactory.Token(SyntaxKind.PublicKeyword))
.AddModifiers(SyntaxFactory.Token(SyntaxKind.ConstKeyword));
}
}
}
32 changes: 32 additions & 0 deletions HearthStone.Database.EnumsGenerator.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27130.2027
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HearthStone.Database.EnumsGenerator", "HearthStone.Database.EnumsGenerator\HearthStone.Database.EnumsGenerator.csproj", "{A521F60B-5A78-4679-AD70-B4DBF72AFCA3}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{E88B4AA9-539D-4372-85B1-9F8F184B70FC}"
ProjectSection(SolutionItems) = preProject
.gitignore = .gitignore
LICENSE = LICENSE
README.md = README.md
EndProjectSection
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{A521F60B-5A78-4679-AD70-B4DBF72AFCA3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{A521F60B-5A78-4679-AD70-B4DBF72AFCA3}.Debug|Any CPU.Build.0 = Debug|Any CPU
{A521F60B-5A78-4679-AD70-B4DBF72AFCA3}.Release|Any CPU.ActiveCfg = Release|Any CPU
{A521F60B-5A78-4679-AD70-B4DBF72AFCA3}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {79FF332E-F967-4C44-80D7-9969C8C9AA59}
EndGlobalSection
EndGlobal
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<Project Sdk="Microsoft.NET.Sdk">

<PropertyGroup>
<TargetFrameworks>net471</TargetFrameworks>
<OutputType>Exe</OutputType>
<StartupObject>HearthStone.Database.EnumsGenerator.Program</StartupObject>
<RootNamespace>HearthStone.Database.EnumsGenerator</RootNamespace>
<AssemblyName>HearthStone.Database.EnumsGenerator</AssemblyName>
<Version>2.0.0</Version>
<Description>HearthStone Database Enums Generator</Description>
<PackageTags>HearthStone Database Enums Generator</PackageTags>
<PackageReleaseNotes>Upgraded build configurations.</PackageReleaseNotes>
<RepositoryType>GIT</RepositoryType>
<RepositoryUrl>https://github.com/Latency/HearthStone.Database</RepositoryUrl>
<Copyright>Copyright © HearthSim</Copyright>
<PackageLicenseUrl>https://opensource.org/licenses/MIT</PackageLicenseUrl>
<Company>HearthSim</Company>
<Authors>HearthSim</Authors>
<PackageIconUrl>https://raw.githubusercontent.com/HearthSim/Hearthstone-Deck-Tracker/master/Hearthstone%20Deck%20Tracker/Images/HearthstoneDeckTracker.ico</PackageIconUrl>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="HearthStone.Database" Version="10.0.1" />
<PackageReference Include="Microsoft.CodeAnalysis" Version="2.6.1" />
<PackageReference Include="Microsoft.CodeAnalysis.CSharp" Version="2.6.1" />
</ItemGroup>

</Project>
Loading

0 comments on commit d194fc7

Please sign in to comment.