All URIs are relative to http://game.host/v1
Method | HTTP request | Description |
---|---|---|
CommitAction | PUT /games/{game_id}/actions | Commit Action |
CreateGame | POST /games/ | Create Game |
GetActions | GET /games/{game_id}/actions | Get games actions |
GetGameState | GET /games/{game_id}/status | Get game status |
GetGames | GET /games/ | Get all games |
GetProgrammingCard | GET /games/{game_id}/statements/{statement_id} | Get Programming Card |
GetProgrammingCardIds | HEAD /games/{game_id}/statements | Get Programming Card IDs |
GetProgrammingCards | GET /games/{game_id}/statements | Get Programming cards |
void CommitAction (int gameId, ActionType action)
Commit Action
Queues an action to be executed
using System.Collections.Generic;
using System.Diagnostics;
using Tgm.Roborally.Api.Api;
using Tgm.Roborally.Api.Client;
using Tgm.Roborally.Api.Model;
namespace Example
{
public class CommitActionExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://game.host/v1";
// Configure API key authorization: player-auth
config.AddApiKey("pat", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("pat", "Bearer");
var apiInstance = new GameApi(config);
var gameId = 56; // int | The id of the game to interact with
var action = ; // ActionType |
try
{
// Commit Action
apiInstance.CommitAction(gameId, action);
}
catch (ApiException e)
{
Debug.Print("Exception when calling GameApi.CommitAction: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
gameId | int | The id of the game to interact with | |
action | ActionType |
void (empty response body)
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
404 | Not Found | - |
409 | Conflict | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
int CreateGame (GameRules gameRules = null)
Create Game
Creates a random game by your defined rules
using System.Collections.Generic;
using System.Diagnostics;
using Tgm.Roborally.Api.Api;
using Tgm.Roborally.Api.Client;
using Tgm.Roborally.Api.Model;
namespace Example
{
public class CreateGameExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://game.host/v1";
// Configure API key authorization: admin-access
config.AddApiKey("skey", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("skey", "Bearer");
var apiInstance = new GameApi(config);
var gameRules = new GameRules(); // GameRules | *Optional* This rules define how your game will behave (optional)
try
{
// Create Game
int result = apiInstance.CreateGame(gameRules);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling GameApi.CreateGame: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
gameRules | GameRules | Optional This rules define how your game will behave | [optional] |
int
- Content-Type: application/json
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
List<Action> GetActions (int gameId, string mode = null)
Get games actions
Get all (not robot related) actions comitted to this game.
using System.Collections.Generic;
using System.Diagnostics;
using Tgm.Roborally.Api.Api;
using Tgm.Roborally.Api.Client;
using Tgm.Roborally.Api.Model;
namespace Example
{
public class GetActionsExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://game.host/v1";
// Configure API key authorization: admin-access
config.AddApiKey("skey", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("skey", "Bearer");
var apiInstance = new GameApi(config);
var gameId = 56; // int | The id of the game to interact with
var mode = mode_example; // string | Defines wich entries to return (optional) (default to ALL)
try
{
// Get games actions
List<Action> result = apiInstance.GetActions(gameId, mode);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling GameApi.GetActions: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
gameId | int | The id of the game to interact with | |
mode | string | Defines wich entries to return | [optional] [default to ALL] |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
201 | Created | - |
404 | Not Found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
GameInfo GetGameState (int gameId)
Get game status
Returns the status of a game
using System.Collections.Generic;
using System.Diagnostics;
using Tgm.Roborally.Api.Api;
using Tgm.Roborally.Api.Client;
using Tgm.Roborally.Api.Model;
namespace Example
{
public class GetGameStateExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://game.host/v1";
var apiInstance = new GameApi(config);
var gameId = 56; // int | The id of the game to interact with
try
{
// Get game status
GameInfo result = apiInstance.GetGameState(gameId);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling GameApi.GetGameState: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
gameId | int | The id of the game to interact with |
No authorization required
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
404 | Not Found | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
List<int> GetGames (bool? joinable = null, bool? unprotected = null)
Get all games
Returns a list of all hosted games
using System.Collections.Generic;
using System.Diagnostics;
using Tgm.Roborally.Api.Api;
using Tgm.Roborally.Api.Client;
using Tgm.Roborally.Api.Model;
namespace Example
{
public class GetGamesExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://game.host/v1";
var apiInstance = new GameApi(config);
var joinable = true; // bool? | true: only return joinable games (optional) (default to false)
var unprotected = true; // bool? | true: only display games with no password set (optional) (default to false)
try
{
// Get all games
List<int> result = apiInstance.GetGames(joinable, unprotected);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling GameApi.GetGames: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
joinable | bool? | true: only return joinable games | [optional] [default to false] |
unprotected | bool? | true: only display games with no password set | [optional] [default to false] |
List
No authorization required
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
RobotCommand GetProgrammingCard (int gameId, int statementId)
Get Programming Card
Get the programming card by id
using System.Collections.Generic;
using System.Diagnostics;
using Tgm.Roborally.Api.Api;
using Tgm.Roborally.Api.Client;
using Tgm.Roborally.Api.Model;
namespace Example
{
public class GetProgrammingCardExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://game.host/v1";
// Configure API key authorization: player-auth
config.AddApiKey("pat", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("pat", "Bearer");
var apiInstance = new GameApi(config);
var gameId = 56; // int | The id of the game to interact with
var statementId = 56; // int | The id of the programming card
try
{
// Get Programming Card
RobotCommand result = apiInstance.GetProgrammingCard(gameId, statementId);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling GameApi.GetProgrammingCard: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
gameId | int | The id of the game to interact with | |
statementId | int | The id of the programming card |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
List<int> GetProgrammingCardIds (int gameId)
Get Programming Card IDs
Get the ids of all programming cards avainable in this game
using System.Collections.Generic;
using System.Diagnostics;
using Tgm.Roborally.Api.Api;
using Tgm.Roborally.Api.Client;
using Tgm.Roborally.Api.Model;
namespace Example
{
public class GetProgrammingCardIdsExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://game.host/v1";
// Configure API key authorization: player-auth
config.AddApiKey("pat", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("pat", "Bearer");
var apiInstance = new GameApi(config);
var gameId = 56; // int | The id of the game to interact with
try
{
// Get Programming Card IDs
List<int> result = apiInstance.GetProgrammingCardIds(gameId);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling GameApi.GetProgrammingCardIds: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
gameId | int | The id of the game to interact with |
List
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]
List<RobotCommand> GetProgrammingCards (int gameId)
Get Programming cards
Returns the Programming cards in this game
using System.Collections.Generic;
using System.Diagnostics;
using Tgm.Roborally.Api.Api;
using Tgm.Roborally.Api.Client;
using Tgm.Roborally.Api.Model;
namespace Example
{
public class GetProgrammingCardsExample
{
public static void Main()
{
Configuration config = new Configuration();
config.BasePath = "http://game.host/v1";
// Configure API key authorization: player-auth
config.AddApiKey("pat", "YOUR_API_KEY");
// Uncomment below to setup prefix (e.g. Bearer) for API key, if needed
// config.AddApiKeyPrefix("pat", "Bearer");
var apiInstance = new GameApi(config);
var gameId = 56; // int | The id of the game to interact with
try
{
// Get Programming cards
List<RobotCommand> result = apiInstance.GetProgrammingCards(gameId);
Debug.WriteLine(result);
}
catch (ApiException e)
{
Debug.Print("Exception when calling GameApi.GetProgrammingCards: " + e.Message );
Debug.Print("Status Code: "+ e.ErrorCode);
Debug.Print(e.StackTrace);
}
}
}
}
Name | Type | Description | Notes |
---|---|---|---|
gameId | int | The id of the game to interact with |
- Content-Type: Not defined
- Accept: application/json
Status code | Description | Response headers |
---|---|---|
200 | OK | - |
[Back to top] [Back to API list] [Back to Model list] [Back to README]