Skip to content

Commit

Permalink
Merge pull request #8 from Fuinny/new-structure
Browse files Browse the repository at this point in the history
Add Playsets folder
  • Loading branch information
Fuinny committed Aug 19, 2024
2 parents 9f849d9 + 8ac771a commit 10f86a9
Show file tree
Hide file tree
Showing 10 changed files with 16 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Documentation/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).

Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
23 changes: 9 additions & 14 deletions Source/Oligopoly.Game/Oligopoly.Game.csproj
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<Nullable>disable</Nullable>
<ImplicitUsings>disable</ImplicitUsings>
<PublishAot>false</PublishAot>
<InvariantGlobalization>false</InvariantGlobalization>
<OutputType>Exe</OutputType>
<TargetFramework>NET8.0</TargetFramework>
<Nullable>Disable</Nullable>
<ImplicitUsings>Disable</ImplicitUsings>
<PublishAot>False</PublishAot>
<InvariantGlobalization>False</InvariantGlobalization>
</PropertyGroup>
<ItemGroup>
<None Update="Data/Companies.xml">
<CopyToOutputDirectory>always</CopyToOutputDirectory>
</None>
<None Update="Data/Events.xml">
<CopyToOutputDirectory>always</CopyToOutputDirectory>
</None>
<None Update="Data/GlobalEvents.xml">
<CopyToOutputDirectory>always</CopyToOutputDirectory>
<None Include="../../Playsets/**/*">
<LinkBase>Playsets</LinkBase>
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
</None>
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -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";

/// <summary>Contains the entry point and main logic of the game.</summary>
private static void Main()
{
Expand Down Expand Up @@ -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()
Expand All @@ -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()
Expand All @@ -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()
Expand Down
File renamed without changes.

0 comments on commit 10f86a9

Please sign in to comment.