Skip to content

Commit

Permalink
refactor: strings, constants, etc
Browse files Browse the repository at this point in the history
  • Loading branch information
cherrynik committed Jul 6, 2024
1 parent 1e5d401 commit 35e0711
Show file tree
Hide file tree
Showing 41 changed files with 165 additions and 951 deletions.
7 changes: 7 additions & 0 deletions MonoGame.sln
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Monogame.ImGuiNet", "src\Li
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "CompositionRoots", "src\Libs\CompositionRoots\CompositionRoots.csproj", "{53310E88-636A-4CA2-A1C8-D1C3FF8B5A61}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Constants", "src\Libs\Constants\Constants.csproj", "{B2BD6683-41F9-414C-AD9C-7F6B4E22B5DC}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -108,6 +110,10 @@ Global
{53310E88-636A-4CA2-A1C8-D1C3FF8B5A61}.Debug|Any CPU.Build.0 = Debug|Any CPU
{53310E88-636A-4CA2-A1C8-D1C3FF8B5A61}.Release|Any CPU.ActiveCfg = Release|Any CPU
{53310E88-636A-4CA2-A1C8-D1C3FF8B5A61}.Release|Any CPU.Build.0 = Release|Any CPU
{B2BD6683-41F9-414C-AD9C-7F6B4E22B5DC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{B2BD6683-41F9-414C-AD9C-7F6B4E22B5DC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{B2BD6683-41F9-414C-AD9C-7F6B4E22B5DC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{B2BD6683-41F9-414C-AD9C-7F6B4E22B5DC}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{5E3B6238-A92E-4703-8527-1C2410D7906A} = {F5258F7E-B0BA-466D-8CF8-4DAB84722BE3}
Expand All @@ -127,5 +133,6 @@ Global
{B7BAA8DC-A62F-4746-B6C4-9908C0AFD30A} = {7AE4DC46-59EB-4F69-9240-C7363F0778AA}
{62A786A2-BC48-453E-8185-01A403B15159} = {FE9CE932-6F98-4455-A80F-2A0CDB6DB46E}
{53310E88-636A-4CA2-A1C8-D1C3FF8B5A61} = {7AE4DC46-59EB-4F69-9240-C7363F0778AA}
{B2BD6683-41F9-414C-AD9C-7F6B4E22B5DC} = {7AE4DC46-59EB-4F69-9240-C7363F0778AA}
EndGlobalSection
EndGlobal
22 changes: 22 additions & 0 deletions src/Apps/GameDesktop/Builders/ConfigurationBuilder.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
using System;
using System.IO;
using Constants;
using Microsoft.Extensions.Configuration;

namespace GameDesktop.Builders;

internal static class ConfigurationBuilder
{
private static string BasePath => Directory.GetParent(AppContext.BaseDirectory)!.FullName;

private static string InEnvironment =>
Environment.GetEnvironmentVariable(EnvironmentNames.DotNetEnvironment) ?? "Production";

public static IConfigurationRoot Create() =>
new Microsoft.Extensions.Configuration.ConfigurationBuilder()
.SetBasePath(BasePath)
.AddJsonFile($"{AppVariables.SettingsFileName}.json", optional: false, reloadOnChange: true)
.AddJsonFile($"{AppVariables.SettingsFileName}.{InEnvironment}.json", optional: true)
.AddEnvironmentVariables()
.Build();
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@
using Serilog;
using Serilog.Core;

namespace GameDesktop.Factories;
namespace GameDesktop.Builders;

internal static class LogFactory
internal static class LoggerBuilder
{
public static Logger Create(IConfiguration configuration) =>
new LoggerConfiguration()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
using Myra.Graphics2D.UI;

namespace GameDesktop.Factories;
namespace GameDesktop.Builders;

public class UIFactory(Grid grid, Label label, ComboBox comboBox, Button button, SpinButton spinButton)
public class UIBuilder(Grid grid, Label label, ComboBox comboBox, Button button, SpinButton spinButton)
{
// Stylesheet.Current.ButtonStyle = new ButtonStyle
// {
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

22 changes: 0 additions & 22 deletions src/Apps/GameDesktop/Factories/ConfigurationFactory.cs

This file was deleted.

Loading

0 comments on commit 35e0711

Please sign in to comment.