Skip to content

Latest commit

 

History

History
378 lines (286 loc) · 9.52 KB

GameApi.md

File metadata and controls

378 lines (286 loc) · 9.52 KB

WerewolfAPI.Api.GameApi

All URIs are relative to https://project-ile.net:1038/v1

Method HTTP request Description
GameActionSessionIDActionIDTargetIDPost POST /game/action/{sessionID}/{actionID}/{targetID} Perform action on a game
GameGet GET /game Get list of games
GameSessionSessionIDDelete DELETE /game/session/{sessionID} Leave a game
GameSessionSessionIDGet GET /game/session/{sessionID} Get game session
GameSessionSessionIDPost POST /game/session/{sessionID} Join a game
GetGameById GET /game/{gameId} Find game by ID

GameActionSessionIDActionIDTargetIDPost

Game GameActionSessionIDActionIDTargetIDPost (string sessionID, long? actionID, long? targetID)

Perform action on a game

Perform action of a user on a game

Example

using System;
using System.Diagnostics;
using WerewolfAPI.Api;
using WerewolfAPI.Client;
using WerewolfAPI.Model;

namespace Example
{
    public class GameActionSessionIDActionIDTargetIDPostExample
    {
        public void main()
        {
            var apiInstance = new GameApi();
            var sessionID = sessionID_example;  // string | ID of player'session to perform action
            var actionID = 789;  // long? | ID of action to perform
            var targetID = 789;  // long? | ID of target of the action

            try
            {
                // Perform action on a game
                Game result = apiInstance.GameActionSessionIDActionIDTargetIDPost(sessionID, actionID, targetID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling GameApi.GameActionSessionIDActionIDTargetIDPost: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
sessionID string ID of player'session to perform action
actionID long? ID of action to perform
targetID long? ID of target of the action

Return type

Game

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GameGet

List GameGet ()

Get list of games

Example

using System;
using System.Diagnostics;
using WerewolfAPI.Api;
using WerewolfAPI.Client;
using WerewolfAPI.Model;

namespace Example
{
    public class GameGetExample
    {
        public void main()
        {
            var apiInstance = new GameApi();

            try
            {
                // Get list of games
                List<Game> result = apiInstance.GameGet();
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling GameApi.GameGet: " + e.Message );
            }
        }
    }
}

Parameters

This endpoint does not need any parameter.

Return type

List

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GameSessionSessionIDDelete

Game GameSessionSessionIDDelete (string sessionID)

Leave a game

Leave game as a player

Example

using System;
using System.Diagnostics;
using WerewolfAPI.Api;
using WerewolfAPI.Client;
using WerewolfAPI.Model;

namespace Example
{
    public class GameSessionSessionIDDeleteExample
    {
        public void main()
        {
            var apiInstance = new GameApi();
            var sessionID = sessionID_example;  // string | ID of player'session to leave game

            try
            {
                // Leave a game
                Game result = apiInstance.GameSessionSessionIDDelete(sessionID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling GameApi.GameSessionSessionIDDelete: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
sessionID string ID of player'session to leave game

Return type

Game

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GameSessionSessionIDGet

Game GameSessionSessionIDGet (string sessionID)

Get game session

Get game session information

Example

using System;
using System.Diagnostics;
using WerewolfAPI.Api;
using WerewolfAPI.Client;
using WerewolfAPI.Model;

namespace Example
{
    public class GameSessionSessionIDGetExample
    {
        public void main()
        {
            var apiInstance = new GameApi();
            var sessionID = sessionID_example;  // string | ID of player'session to get game information

            try
            {
                // Get game session
                Game result = apiInstance.GameSessionSessionIDGet(sessionID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling GameApi.GameSessionSessionIDGet: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
sessionID string ID of player'session to get game information

Return type

Game

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GameSessionSessionIDPost

Game GameSessionSessionIDPost (string sessionID)

Join a game

Join an available game as a player

Example

using System;
using System.Diagnostics;
using WerewolfAPI.Api;
using WerewolfAPI.Client;
using WerewolfAPI.Model;

namespace Example
{
    public class GameSessionSessionIDPostExample
    {
        public void main()
        {
            var apiInstance = new GameApi();
            var sessionID = sessionID_example;  // string | ID of player'session to join game

            try
            {
                // Join a game
                Game result = apiInstance.GameSessionSessionIDPost(sessionID);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling GameApi.GameSessionSessionIDPost: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
sessionID string ID of player'session to join game

Return type

Game

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]

GetGameById

Game GetGameById (long? gameId)

Find game by ID

Returns a single game

Example

using System;
using System.Diagnostics;
using WerewolfAPI.Api;
using WerewolfAPI.Client;
using WerewolfAPI.Model;

namespace Example
{
    public class GetGameByIdExample
    {
        public void main()
        {
            var apiInstance = new GameApi();
            var gameId = 789;  // long? | ID of game to return

            try
            {
                // Find game by ID
                Game result = apiInstance.GetGameById(gameId);
                Debug.WriteLine(result);
            }
            catch (Exception e)
            {
                Debug.Print("Exception when calling GameApi.GetGameById: " + e.Message );
            }
        }
    }
}

Parameters

Name Type Description Notes
gameId long? ID of game to return

Return type

Game

Authorization

No authorization required

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

[Back to top] [Back to API list] [Back to Model list] [Back to README]