Skip to content

Commit

Permalink
add docfx documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
InfectedBytes committed Aug 7, 2018
1 parent 439befb commit 39c1115
Show file tree
Hide file tree
Showing 10 changed files with 230 additions and 0 deletions.
8 changes: 8 additions & 0 deletions docfx/.gitignore
@@ -0,0 +1,8 @@
###############
# folder #
###############
/**/DROP/
/**/TEMP/
/**/packages/
/**/bin/
/**/obj/
5 changes: 5 additions & 0 deletions docfx/api/.gitignore
@@ -0,0 +1,5 @@
###############
# temp file #
###############
*.yml
.manifest
75 changes: 75 additions & 0 deletions docfx/articles/intro.md
@@ -0,0 +1,75 @@
# Introduction to `GameJoltDotNet`
The [`GameJolt Game API`](https://gamejolt.com/game-api/doc) is a service provided by [GameJolt](https://gamejolt.com/),
which provides you with a number of cloud based features for your game, including:
* Online score tables
* Trophies (achievements)
* Cloud data storage
* Game session logging
* User verification

In order to use these features, one has to communicate with the GameJolt servers through their RESTful web service.

`GameJoltDotNet` is a `.NET` library which implements all of GameJolt's services and provides you with a clean and
simple interface to communicate with the GameJolt servers. It is written in `C#` and fully documented by using `C#'s`
xml documentations comments.

## Install
The easiest way to add this library to your project is by using NuGet.
Just add the [`GameJoltDotNet`](https://www.nuget.org/packages/GameJoltDotNet/) NuGet package to your project and you're done.

Alternatively you can also download the compiled dll from [github](https://github.com/InfectedBytes/GameJoltDotNet/releases)
or [GameJolt](https://gamejolt.com/games/gamejoltdotnet/358157) and then add a reference to it in your project.

## Supported .NET Frameworks
For best portability this library is based on .NET Standard 1.3 and can therefore be used on a wide variety of different platforms.
The following platforms are supported:

Framework | Version
----- | -----
.NET Standard | 1.3
.NET Core | 1.0
.NET Framework | 4.6
Mono | 4.6
Xamarin.iOS | 10.0
Xamarin.Mac | 3.0
Xamarin.Android | 7.0
Universal Windows Platform | 10.0

## Supported Languages
Since this library is written in plain `C#`, the compiled DLL can be used by any `.NET` language, for example:
* `C#`
* `Visual Basic .NET`
* `F#`
* `Nemerle`
* etc.

Just add a reference to `GameJolt.dll` and you're ready to got.

## Simple Example
First of all you have to create a new api instance:
```cs
var api = new GameJoltApi(gameId, privateKey);
```
Afterwards you can directly use the different GameJolt features.
```cs
// by using async/await:
var response = await api.Scores.FetchAsync();
if(response.Success) {
// response.Data contains the list of scores
}

// or by using the callback mechanism:
api.Scores.Fetch(callback: response => {
if(response.Success) {
// response.Data contains the list of scores
}
});
```

Some APIs require an authenticated user, because they set or get data for a certain user. The authentication can be done like so:
```cs
var auth = await api.Users.AuthAsync(userName, userToken);
if(auth.Success) {
api.Trophies.SetAchieved(auth.Data, trophyId);
}
```
2 changes: 2 additions & 0 deletions docfx/articles/toc.yml
@@ -0,0 +1,2 @@
- name: Introduction
href: intro.md
70 changes: 70 additions & 0 deletions docfx/docfx.json
@@ -0,0 +1,70 @@
{
"metadata": [
{
"src": [
{
"files": [
"GameJolt/**.csproj"
],
"src" : ".."
}
],
"dest": "api",
"disableGitFeatures": false,
"disableDefaultFilter": false
}
],
"build": {
"content": [
{
"files": [
"api/**.yml"
]
},
{
"files": [
"articles/**.md",
"articles/**/toc.yml",
"toc.yml",
"*.md"
]
}
],
"resource": [
{
"files": [
"images/**",
"favicon.ico",
"logo.png"
]
}
],
"overwrite": [
{
"files": [
"apidoc/**.md"
],
"exclude": [
"obj/**",
"_site/**"
]
}
],
"dest": "../docs",
"globalMetadata": {
"_appFaviconPath" : "favicon.ico",
"_appLogoPath": "logo.png"
},
"globalMetadataFiles": [],
"fileMetadataFiles": [],
"template": [
"default"
],
"postProcessors": [],
"markdownEngineName": "markdig",
"noLangKeyword": false,
"keepFileLink": false,
"cleanupCacheHistory": false,
"disableGitFeatures": false
}
}
Binary file added docfx/favicon.ico
Binary file not shown.
Binary file added docfx/images/gamejolt.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
63 changes: 63 additions & 0 deletions docfx/index.md
@@ -0,0 +1,63 @@
![GameJolt](images/gamejolt.png)

# `GameJoltDotNet`
GameJoltDotNet is a GameJolt [Game API](https://gamejolt.com/game-api/doc) client for the `.NET` Framework
and can therefore be used by every `.NET` language, like `C#`, `VB.NET` or `F#`.

For best portability this library is based on .NET Standard 1.3 and can therefore be used on a wide variety of different platforms.
The following platforms are supported:

Framework | Version
----- | -----
.NET Standard | 1.3
.NET Core | 1.0
.NET Framework | 4.6
Mono | 4.6
Xamarin.iOS | 10.0
Xamarin.Mac | 3.0
Xamarin.Android | 7.0
Universal Windows Platform | 10.0


## GameJolt API Overview
Service | Description
----- | -----
Datastore | Manipulate items in a cloud-based data storage.
Time | Get the server's time.
Scores | Manipulate scores on score tables.
Sessions | Set up sessions for your game.
Trophies | Manage trophies for your game.
Users | Access user-based features.
Friends | List a user's friends.

This library is heavily based on the async/await mechanism of C# and can therefore be used without blocking the main thread.
Furthermore it provides a convenience facade API, which internally uses the async/await API, but provides a simple, callback based API as a front end.

## Example
First of all you have to create a new api instance:
```cs
var api = new GameJoltApi(gameId, privateKey);
```
Afterwards you can directly use the different GameJolt features.
```cs
// by using async/await:
var response = await api.Scores.FetchAsync();
if(response.Success) {
// response.Data contains the list of scores
}

// or by using the callback mechanism:
api.Scores.Fetch(callback: response => {
if(response.Success) {
// response.Data contains the list of scores
}
});
```

Some APIs require an authenticated user, because they set or get data for a certain user. The authentication can be done like so:
```cs
var auth = await api.Users.AuthAsync(userName, userToken);
if(auth.Success) {
api.Trophies.SetAchieved(auth.Data, trophyId);
}
```
Binary file added docfx/logo.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
7 changes: 7 additions & 0 deletions docfx/toc.yml
@@ -0,0 +1,7 @@
- name: Articles
href: articles/
- name: Api Documentation
href: api/
homepage: api/GameJolt.yml
- name: Source 🔗
href: https://github.com/InfectedBytes/GameJoltDotNet

0 comments on commit 39c1115

Please sign in to comment.