-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Initial docfx setup * Updates to landing page and general docs * Ripped readme into files * Update index.md * Update getting-started.md * Docfx devops (#57) * Create docs-publish * Update docs-publish * Update docs-publish * Update docs-publish * Update docs-publish * Update docs-publish * Update docs-publish ---------
- Loading branch information
1 parent
bf66a3f
commit 3503195
Showing
7 changed files
with
260 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
name: docs-publish | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: read | ||
|
||
env: | ||
DOTNET_VERSION: '8.0' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Setup environment | ||
uses: actions/setup-dotnet@v3 | ||
with: | ||
dotnet-version: ${{ env.DOTNET_VERSION }} | ||
|
||
- name: Install dependencies | ||
run: dotnet restore | ||
|
||
- name: Update docfx | ||
run: dotnet tool update -g docfx | ||
|
||
- name: Build | ||
run: dotnet build | ||
|
||
- name: Build documentation | ||
run: docfx BP.AdventureFramework/docs/docfx/docfx.json | ||
|
||
- name: Copy documentation to BP.AdventureFramework-docs repository | ||
run: | | ||
mkdir temp | ||
cp -r BP.AdventureFramework/docs/docfx/_site/* temp/ | ||
rm -rf BP.AdventureFramework/docs/docfx/_site/* | ||
cp -r temp/* BP.AdventureFramework-docs/ | ||
rm -rf temp | ||
|
||
- name: Commit and push changes to BP.AdventureFramework-docs | ||
run: | | ||
cd BP.AdventureFramework-docs | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git add . | ||
git commit -m "Update documentation" | ||
git remote add docs-repo https://github.com/benpollarduk/BP.AdventureFramework-docs.git | ||
git push docs-repo main | ||
env: | ||
PAT: ${{ secrets.PAT }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
{ | ||
"metadata": [ | ||
{ | ||
"src": [ | ||
{ | ||
"src": "../../BP.AdventureFramework", | ||
"files": [ | ||
"**/*.csproj" | ||
] | ||
} | ||
], | ||
"dest": "api" | ||
} | ||
], | ||
"build": { | ||
"content": [ | ||
{ | ||
"files": [ | ||
"**/*.{md,yml}" | ||
], | ||
"exclude": [ | ||
"_site/**" | ||
] | ||
} | ||
], | ||
"resource": [ | ||
{ | ||
"files": [ | ||
"images/**" | ||
] | ||
} | ||
], | ||
"output": "_site", | ||
"template": [ | ||
"default", | ||
"modern" | ||
], | ||
"globalMetadata": { | ||
"_appName": "BP.AdventureFramework", | ||
"_appTitle": "BP.AdventureFramework", | ||
"_enableSearch": true, | ||
"pdf": true | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Getting Started | ||
|
||
## Clone the repo | ||
Clone the repo to the local machine. | ||
```bash | ||
git clone https://github.com/benpollarduk/adventure-framework.git | ||
``` | ||
|
||
## Hello World | ||
```csharp | ||
// create the player. this is the character the user plays as | ||
var player = new PlayableCharacter("Dave", "A young boy on a quest to find the meaning of life."); | ||
|
||
/// create region maker. the region maker simplifies creating in game regions. a region contains a series of rooms | ||
var regionMaker = new RegionMaker("Mountain", "An imposing volcano just East of town.") | ||
{ | ||
// add a room to the region at position x 0, y 0, z 0 | ||
[0, 0, 0] = new Room("Cavern", "A dark cavern set in to the base of the mountain.") | ||
}; | ||
|
||
// create overworld maker. the overworld maker simplifies creating in game overworlds. an overworld contains a series or regions | ||
var overworldMaker = new OverworldMaker("Daves World", "An ancient kingdom.", regionMaker); | ||
|
||
// create callback for generating games | ||
var gameCreator = Game.Create("The Life Of Dave", | ||
"Dave awakes to find himself in a cavern...", | ||
"A very low budget adventure.", | ||
x => overworldMaker.Make(), | ||
() => player, | ||
x => CompletionCheckResult.NotComplete); | ||
|
||
// begin the execution of the game | ||
Game.Execute(gameCreator); | ||
``` | ||
|
||
## Example game | ||
The quickest way to start getting to grips with the structure of BP.AdventureFramework is by taking a look at the examples. | ||
An example game is provided in the [BP.AdventureFramework.Examples](https://github.com/benpollarduk/adventure-framework/tree/main/BP.AdventureFramework.Examples) directory | ||
and have been designed with the aim of showcasing the various features. | ||
|
||
## Running the examples | ||
The example applications can be used to execute the example BP.AdventureFramework game and demonstrate the core principals of the framework. | ||
Set the **BP.AdventureFramweork.Examples** project as the start up project and build and run to start the application. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
- name: Getting Started | ||
href: getting-started.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
--- | ||
_layout: landing | ||
--- | ||
# BP.AdventureFramework | ||
A C# library that provides a framework for building text adventures and interactive stories in .NET. | ||
|
||
## Overview | ||
BP.AdventureFramework is a .NET Standard 2.0 implementation of a framework for building text based adventures. | ||
|
||
At its core BP.AdventureFramework provides simple classes for developing game elements: | ||
|
||
### Environments | ||
Environments are broken down in to three elements - Overworld, Region and Room. An Overworld contains one or more Regions. A Region contains one or more Rooms. | ||
A Room can contain up to six exits (north, south, east, west, up and down). | ||
|
||
``` | ||
Overworld | ||
├── Region | ||
│ ├── Room | ||
│ ├── Room | ||
│ ├── Room | ||
├── Region | ||
│ ├── Room | ||
│ ├── Room | ||
``` | ||
|
||
### Exits | ||
Rooms contain exits. Exits can be locked to block progress through the game. | ||
|
||
```csharp | ||
// create a test room | ||
var room = new Room("Test Room", "A test room."); | ||
|
||
// add an exit to the north | ||
room.AddExit(new Exit(Direction.North)); | ||
``` | ||
|
||
### Items | ||
Items add richness the game. Items support interaction with the player, rooms, other items and NPC's. Items can morph in to other items. | ||
For example, using item A on item B may cause item B to morph into item C. | ||
|
||
```csharp | ||
var sword = new Item("Sword", "The heroes sword."); | ||
``` | ||
|
||
### Playable Character | ||
Each BP.AdventureFramework game has a single playable charcter. This who the player controls. | ||
|
||
```csharp | ||
var player = new PlayableChracter("Dave", "The hero of the story."); | ||
``` | ||
|
||
### Non-playable Characters | ||
Non-playable characters (NPC's) can be added to rooms and can help drive the narrative. NPC's can hold conversations, contains items, | ||
and interact with items. | ||
|
||
```csharp | ||
var npc = new NonPlayableChracter("Gary", "The antagonist of the story."); | ||
``` | ||
|
||
### Commands | ||
|
||
BP.AdventureFramework provides commands for interacting with game elements: | ||
* **Drop X** - drop an item. | ||
* **Examine X** - allows items, characters and environments to be examined. | ||
* **Take X** - take an item. | ||
* **Talk to X** - talk to a NPC, where X is the NPC. | ||
* **Use X on Y** - use an item. Items can be used on a variety of targets. Where X is the item and Y is the target. | ||
* **N, S, E, W, U, D** - traverse through the rooms in a region. | ||
|
||
BP.AdventureFramework also provides global commands to help with game flow and option management: | ||
* **About** - display version information. | ||
* **CommandsOn / CommandsOff** - toggle commands on/off. | ||
* **Exit** - exit the game. | ||
* **Help** - display the help screen. | ||
* **KeyOn / KeyOff** - turn the Key on/off. | ||
* **Map** - display the map. | ||
* **New** - start a new game. | ||
|
||
Custom commands can be added to games without the need to extend the existing interpretation. | ||
|
||
### Interpretation | ||
|
||
BP.AdventureFramework provides classes for handling interpretation of input. Interpretation is extensible with the ability for custom interpreters to be added outside of the core BP.AdventureFramework library. | ||
|
||
### Conversations | ||
|
||
Conversations can be held between the player and a NPC. Conversations support multiple lines of dialogue and responses. | ||
|
||
### Rendering | ||
|
||
BP.AdventureFramework provides frames for rendering the various game screens. These are fully extensible and customisable. These include: | ||
* Scene frame. | ||
* Help frame. | ||
* Map frame. | ||
* Title frame. | ||
* Completion frame. | ||
* Game over frame. | ||
* Transition frame. | ||
* Conversation frame. | ||
|
||
### Maps | ||
|
||
Maps are automatically generated for regions and rooms, and can be viewed with the **map** command: | ||
|
||
Maps display visited rooms, exits, player position, if an item is in a room, lower floors and more. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
- name: Docs | ||
href: docs/ | ||
- name: API | ||
href: api/ |