Skip to content

Commit

Permalink
Merge pull request #5 from Fuinny/new-file-structure
Browse files Browse the repository at this point in the history
  • Loading branch information
Fuinny committed Jul 14, 2023
2 parents 7a53009 + c08ecf9 commit 238c2a2
Show file tree
Hide file tree
Showing 16 changed files with 184 additions and 144 deletions.
80 changes: 0 additions & 80 deletions DOCUMENTATION.md

This file was deleted.

28 changes: 28 additions & 0 deletions Documentation/How-to-add-company.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# :question: How to add your own company
1. Open ```Companies.xml``` file.
2. Find ```Company``` element.
3. Copy the following template and paste it below last ```Company``` element:

```xml
<Company id="COMPANY_ID">
<Name>COMPANY_NAME</Name>
<Industry>COMPANY_INDUSTRY</Industry>
<SharePrice>COMPANY_SHARE_PRICE</SharePrice>
<Description>COMPANY_DESCRIPTION</Description>
</Company>
```

5. Replace **COMPANY_ID**, **COMPANY_NAME**, **COMPANY_INDUSTRY**, **COMPANY_SHARE_PRICE**, and **COMPANY_DESCRIPTION** with the appropriate values for your new company.
6. Save the changes to the ```Companies.xml``` file.

> **Please note:**
>
> **COMPANY_ID** - can be anything, make it so that it is easier for you to navigate in the ```.xml``` file, **but** you need to use underscore between words. Company name is used by default, but you can use something else.
>
> Example: ```ABC_Company_Id```
>
> **COMPANY_NAME**, **COMPANY_INDUSTRY** and **COMPANY_DESCRIPTION** - can be anything, except null or whitespace.
>
> Example: ```ABC Company Name```, ```ABC Company Industry``` and ```ABC Company long-long-long description.```
>
> **COMPANY_SHARE_PRICE** - can be any value greater than zero.
33 changes: 33 additions & 0 deletions Documentation/How-to-add-event.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# :question: How to add your own event
1. Open ```Events.xml``` file.
2. Find ```Event``` element.
3. Copy the following template and paste it below last ```Event``` element:

```xml
<Event id="EVENT_ID">
<Effect>EVENT_EFFECT</Effect>
<Target>EVENT_TARGET</Target>
<Title>EVENT_TITLE</Title>
<Content>EVENT_CONTENT</Content>
</Event>
```

5. Replace **EVENT_ID**, **EVENT_EFFECT**, **EVENT_TARGET**, **EVENT_TITLE** and **EVENT_CONTENT** with the appropriate values for your new event.
6. Save the changes to the ```Events.xml``` file.

> **Please note:**
>
> **EVENT_ID** - can be anything, make it so that it is easier for you to navigate in the xml file, **but** you need to use underscore between words.
> The default structure is: Company_Event, but you can use other structure.
>
> Example: ```ABC_Company_new_event```
>
> **EVENT_EFFECT** - can be any integer except zero.
>
> **EVENT_TARGET** - **must** match the name of the company to which the effect is to be applied. Obviously cannot be null or whitespace.
>
> Example: ```ABC Company Name```
>
> **EVENT_TITLE** and **EVENT_CONTENT** - can be anything, except null or whitespace.
>
> Example: ```ABC Company something happened``` and ```ABC Company long-long-long event content.```
28 changes: 28 additions & 0 deletions Documentation/How-to-add-global-event.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# :question: How to add your own global event
1. Open ```GlobalEvents.xml``` file.
2. Find ```GlobalEvent``` element.
3. Copy the following template and paste it below last ```GlobalEvent``` element:

```xml
<GlobalEvent id="GLOBAL_EVENT_ID">
<Effect>GLOBAL_EVENT_EFFECT</Effect>
<Title>GLOBAL_EVENT_TITLE</Title>
<Content>GLOBAL_EVENT_CONTENT</Content>
</GlobalEvent>
```

5. Replace **GLOBAL_EVENT_ID**, **GLOBAL_EVENT_EFFECT**, **GLOBAL_EVENT_TITLE** and **GLOBAL_EVENT_CONTENT** with the appropriate values for your new event.
6. Save the changes to the ```GlobalEvents.xml``` file.

> **Please note:**
>
> **GLOBAL_EVENT_ID*** - can be anything, make it so that it is easier for you to navigate in the xml file, **but** you need to use underscore between words.
> The default structure is: Company_Event, but you can use other structure.
>
> Example: ```ABC_Company_new_event```
>
> **GLOBAL_EVENT_EFFECT** - can be any integer except zero.
>
> **GLOBAL_EVENT_TITLE** and **GLOBAL_EVENT_CONTENT** - can be anything, except null or whitespace.
>
> Example: ```ABC Company something happened``` and ```ABC Company long-long-long event content.```
30 changes: 30 additions & 0 deletions Documentation/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<div>
<img align="left" src="https://github.com/Fuinny/Oligopoly/blob/main/.github/resources/oligopoly-logo.svg" width="128" height="128"/>
<h1>
Oligopoly
<br>
Documentation Hub
</h1>
<p align="left">
<a href="https://github.com/Fuinny/Oligopoly"><img src="https://github.com/Fuinny/Oligopoly/blob/main/.github/resources/github-repo.svg" alt="GitHub Repository"></a>
<a href="https://github.com/dotnet/dotnet-console-games"><img src="https://github.com/Fuinny/Oligopoly/blob/main/.github/resources/also-available.svg" alt="dotnet-console-games Repository"></a>
<a href="https://learn.microsoft.com/en-us/dotnet/csharp/"><img src="https://github.com/Fuinny/Oligopoly/blob/main/.github/resources/c-sharp-language.svg" alt="C Sharp Language"></a>
<a href="https://dotnet.microsoft.com/en-us/download"><img src="https://github.com/Fuinny/Oligopoly/blob/main/.github/resources/target-framework.svg" alt="Target Framework"></a>
<a href="https://github.com/Fuinny/Oligopoly/blob/main/LICENSE.md"><img src="https://github.com/Fuinny/Oligopoly/blob/main/.github/resources/license-MIT.svg" alt="Target Framework"></a>
</p>
</div>

# :open_book: Description
This documentation provides instructions on how to add your own content to the game like: companies, events, global events or edit existing content.
To make these changes, you will need to edit the appropriate ```.xml``` file in ```Data``` folder. It's not hard at all :D

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/new-file-structure/Source/Oligopoly.Game/Data).

If you want to add your ```company``` to the game, you can find instructions [here](https://github.com/Fuinny/Oligopoly/blob/new-file-structure/Documentation/How-to-add-company.md).

If you want to add your ```events``` to the game, you can find instructions [here](https://github.com/Fuinny/Oligopoly/blob/new-file-structure/Documentation/How-to-add-event.md).

If you want to add your ```global events``` to the game, you can find instructions [here](https://github.com/Fuinny/Oligopoly/blob/new-file-structure/Documentation/How-to-add-global-event.md).
15 changes: 10 additions & 5 deletions Oligopoly.sln
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,27 @@ Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 17
VisualStudioVersion = 17.5.33530.505
MinimumVisualStudioVersion = 10.0.40219.1
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Oligopoly", "Oligopoly\Oligopoly.csproj", "{47B0EADF-B6C0-40F4-A034-9F559AEC7D18}"
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Source", "Source", "{E1685C41-EF1E-45FD-9FD5-1C3E769BCA35}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Oligopoly.Game", "Source\Oligopoly.Game\Oligopoly.Game.csproj", "{61F60199-937A-4B87-B5B7-E70318482D95}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Release|Any CPU = Release|Any CPU
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{47B0EADF-B6C0-40F4-A034-9F559AEC7D18}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{47B0EADF-B6C0-40F4-A034-9F559AEC7D18}.Debug|Any CPU.Build.0 = Debug|Any CPU
{47B0EADF-B6C0-40F4-A034-9F559AEC7D18}.Release|Any CPU.ActiveCfg = Debug|Any CPU
{47B0EADF-B6C0-40F4-A034-9F559AEC7D18}.Release|Any CPU.Build.0 = Debug|Any CPU
{61F60199-937A-4B87-B5B7-E70318482D95}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{61F60199-937A-4B87-B5B7-E70318482D95}.Debug|Any CPU.Build.0 = Debug|Any CPU
{61F60199-937A-4B87-B5B7-E70318482D95}.Release|Any CPU.ActiveCfg = Release|Any CPU
{61F60199-937A-4B87-B5B7-E70318482D95}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{61F60199-937A-4B87-B5B7-E70318482D95} = {E1685C41-EF1E-45FD-9FD5-1C3E769BCA35}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {DE654BE1-60EF-4C2A-B4E7-783D35FCF7FC}
EndGlobalSection
Expand Down
45 changes: 0 additions & 45 deletions Oligopoly/Data/Companies.xml

This file was deleted.

12 changes: 4 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
<h1>
Oligopoly
<br>
A stock market betting game.
A stock market betting game
</h1>
<p align="left">
<a href="https://github.com/Fuinny/Oligopoly"><img src="https://github.com/Fuinny/Oligopoly/blob/main/.github/resources/github-repo.svg" alt="GitHub Repository"></a>
Expand Down Expand Up @@ -89,15 +89,11 @@ After following any of these methods, you should be able to run Oligopoly in you

Also, thanks for playing or trying to play this simple CLI game! It means a lot :P

## :question: How to add your own company and event
This game supports the ability to add your companies and events to the game or edit existing ones.

To make these changes, you need to edit the .xml files in Data folder.

You can read more information about the files structure [here](https://github.com/Fuinny/Oligopoly/blob/master/DOCUMENTATION.md).
## :mag_right: Additional information
If you want to add your content to the game or you are just curious about how the game files are organized for some reason, you can look at this [kind of documentation](https://github.com/Fuinny/Oligopoly/blob/new-file-structure/Documentation/README.md).

## :heart: Special thanks
I want to give a special thanks to [ZacharyPatten](https://github.com/ZacharyPatten) for creating the web version, as well as improving the code and concept of the game!

## :balance_scale: License
This project and [Oligopoly logo](https://github.com/Fuinny/Oligopoly/blob/main/.github/resources/oligopoly-logo.svg) are licensed under the [MIT License](https://github.com/Fuinny/Oligopoly/blob/master/LICENSE.md).
This project and [Oligopoly logo](https://github.com/Fuinny/Oligopoly/blob/main/.github/resources/oligopoly-logo.svg) are licensed under the [MIT License](https://github.com/Fuinny/Oligopoly/blob/main/LICENSE.md).
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -110,4 +110,4 @@ public string Content
}
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -220,4 +220,4 @@ public static StringBuilder DrawCompaniesTable(List<Company> companies)
return companiesTable;
}
}
}
}
File renamed without changes.
Loading

0 comments on commit 238c2a2

Please sign in to comment.