From 4af95e370694adbecf7cc9789b28daa93d2d5880 Mon Sep 17 00:00:00 2001 From: Semion Medvedev <126599206+Fuinny@users.noreply.github.com> Date: Sat, 17 Aug 2024 22:22:08 +0300 Subject: [PATCH 1/2] Update project structure --- .../Data => Playsets/Standard}/Companies.xml | 0 .../Data => Playsets/Standard}/Events.xml | 0 .../Standard}/GlobalEvents.xml | 0 Source/Oligopoly.Game/{Code => }/Company.cs | 0 Source/Oligopoly.Game/{Code => }/Event.cs | 0 Source/Oligopoly.Game/{Code => }/Menu.cs | 0 Source/Oligopoly.Game/Oligopoly.Game.csproj | 23 ++++++++----------- Source/Oligopoly.Game/{Code => }/Program.cs | 9 +++++--- .../{Code => }/_GlobalUsings.cs | 0 9 files changed, 15 insertions(+), 17 deletions(-) rename {Source/Oligopoly.Game/Data => Playsets/Standard}/Companies.xml (100%) rename {Source/Oligopoly.Game/Data => Playsets/Standard}/Events.xml (100%) rename {Source/Oligopoly.Game/Data => Playsets/Standard}/GlobalEvents.xml (100%) rename Source/Oligopoly.Game/{Code => }/Company.cs (100%) rename Source/Oligopoly.Game/{Code => }/Event.cs (100%) rename Source/Oligopoly.Game/{Code => }/Menu.cs (100%) rename Source/Oligopoly.Game/{Code => }/Program.cs (99%) rename Source/Oligopoly.Game/{Code => }/_GlobalUsings.cs (100%) diff --git a/Source/Oligopoly.Game/Data/Companies.xml b/Playsets/Standard/Companies.xml similarity index 100% rename from Source/Oligopoly.Game/Data/Companies.xml rename to Playsets/Standard/Companies.xml diff --git a/Source/Oligopoly.Game/Data/Events.xml b/Playsets/Standard/Events.xml similarity index 100% rename from Source/Oligopoly.Game/Data/Events.xml rename to Playsets/Standard/Events.xml diff --git a/Source/Oligopoly.Game/Data/GlobalEvents.xml b/Playsets/Standard/GlobalEvents.xml similarity index 100% rename from Source/Oligopoly.Game/Data/GlobalEvents.xml rename to Playsets/Standard/GlobalEvents.xml diff --git a/Source/Oligopoly.Game/Code/Company.cs b/Source/Oligopoly.Game/Company.cs similarity index 100% rename from Source/Oligopoly.Game/Code/Company.cs rename to Source/Oligopoly.Game/Company.cs diff --git a/Source/Oligopoly.Game/Code/Event.cs b/Source/Oligopoly.Game/Event.cs similarity index 100% rename from Source/Oligopoly.Game/Code/Event.cs rename to Source/Oligopoly.Game/Event.cs diff --git a/Source/Oligopoly.Game/Code/Menu.cs b/Source/Oligopoly.Game/Menu.cs similarity index 100% rename from Source/Oligopoly.Game/Code/Menu.cs rename to Source/Oligopoly.Game/Menu.cs diff --git a/Source/Oligopoly.Game/Oligopoly.Game.csproj b/Source/Oligopoly.Game/Oligopoly.Game.csproj index 9ee93e2..ad9eaf7 100644 --- a/Source/Oligopoly.Game/Oligopoly.Game.csproj +++ b/Source/Oligopoly.Game/Oligopoly.Game.csproj @@ -1,21 +1,16 @@  - exe - net8.0 - disable - disable - false - false + Exe + NET8.0 + Disable + Disable + False + False - - always - - - always - - - always + + Playsets + Always \ No newline at end of file diff --git a/Source/Oligopoly.Game/Code/Program.cs b/Source/Oligopoly.Game/Program.cs similarity index 99% rename from Source/Oligopoly.Game/Code/Program.cs rename to Source/Oligopoly.Game/Program.cs index b0a93d3..c460fcb 100644 --- a/Source/Oligopoly.Game/Code/Program.cs +++ b/Source/Oligopoly.Game/Program.cs @@ -23,6 +23,9 @@ public class Program private const decimal LosingNetWorth = 2000.00M; private const decimal WinningNetWorth = 50000.00M; + private const string PlaysetsPath = "Playsets"; + private const string SelectedPlaysetPath = "Standard"; + /// Contains the entry point and main logic of the game. private static void Main() { @@ -83,7 +86,7 @@ private static void LoadEmbeddedResources() { XDocument xmlDocument; - xmlDocument = XDocument.Load(Path.Combine("Data", "Companies.xml")); + xmlDocument = XDocument.Load(Path.Combine(PlaysetsPath, SelectedPlaysetPath, "Companies.xml")); foreach (XElement companyElement in xmlDocument.Root.Elements("Company")) { Company currentCompany = new() @@ -97,7 +100,7 @@ private static void LoadEmbeddedResources() s_companies.Add(currentCompany); } - xmlDocument = XDocument.Load(Path.Combine("Data", "Events.xml")); + xmlDocument = XDocument.Load(Path.Combine(PlaysetsPath, SelectedPlaysetPath, "Events.xml")); foreach (XElement eventElement in xmlDocument.Root.Elements("Event")) { Event currentEvent = new() @@ -111,7 +114,7 @@ private static void LoadEmbeddedResources() s_events.Add(currentEvent); } - xmlDocument = XDocument.Load(Path.Combine("Data", "GlobalEvents.xml")); + xmlDocument = XDocument.Load(Path.Combine(PlaysetsPath, SelectedPlaysetPath, "GlobalEvents.xml")); foreach (XElement globalEventElement in xmlDocument.Root.Elements("GlobalEvent")) { Event currentGlobalEvent = new() diff --git a/Source/Oligopoly.Game/Code/_GlobalUsings.cs b/Source/Oligopoly.Game/_GlobalUsings.cs similarity index 100% rename from Source/Oligopoly.Game/Code/_GlobalUsings.cs rename to Source/Oligopoly.Game/_GlobalUsings.cs From 8ac771aa017bbbb8006f3f27bc98cd5de83b7278 Mon Sep 17 00:00:00 2001 From: Semion Medvedev <126599206+Fuinny@users.noreply.github.com> Date: Mon, 19 Aug 2024 12:38:10 +0300 Subject: [PATCH 2/2] Update documentation links --- Documentation/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/README.md b/Documentation/README.md index 198fb8f..bc821b1 100644 --- a/Documentation/README.md +++ b/Documentation/README.md @@ -21,7 +21,7 @@ To make these changes, you will need to edit the appropriate ```.xml``` file in Also, thank you for your interest in adding your own content to the game :P # :globe_with_meridians: Links -All standard ```.xml``` files in the ```Data``` folder you can see [here](https://github.com/Fuinny/Oligopoly/tree/main/Source/Oligopoly.Game/Data). +All standard ```.xml``` files in the ```Playsets``` folder you can see [here](https://github.com/Fuinny/Oligopoly/tree/main/Playsets). If you want to add your ```company``` to the game, you can find instructions [here](https://github.com/Fuinny/Oligopoly/blob/main/Documentation/How-to-add-company.md).