Skip to content

Latest commit

 

History

History
959 lines (751 loc) · 29.6 KB

File metadata and controls

959 lines (751 loc) · 29.6 KB

Tgm.Roborally.Api.Api.RobotsApi

All URIs are relative to http://game.host/v1

Method HTTP request Description
ClearRegisters DELETE /games/{game_id}/entities/robots/{robot_id}/registers clear registers
ClearUpgrades DELETE /games/{game_id}/entities/robots/{robot_id}/upgrades Clear Robot Upgrades
DoEntityAction POST /games/{game_id}/entities/robots/{robot_id}/actions/stack/ Add Entity Action to stack
GetActionStack GET /games/{game_id}/entities/robots/{robot_id}/actions/stack/ Get Robot action stack
GetInstalledUpgrades GET /games/{game_id}/entities/robots/{robot_id}/upgrades Get Robot Upgrades
GetPossibleActions GET /games/{game_id}/entities/robots/{robot_id}/actions/avinable Get Aviable actions
GetRegisterContent GET /games/{game_id}/entities/robots/{robot_id}/registers/{register} Get Register Content
GetRegisters GET /games/{game_id}/entities/robots/{robot_id}/registers Get register information
GetRobotStats GET /games/{game_id}/entities/robots/{robot_id}/info Get Robot Informations
GetRobots GET /games/{game_id}/entities/robots/ Get all robots
RemoveRobotUpgrade PATCH /games/{game_id}/entities/robots/{robot_id}/upgrades Remove Upgrade
SetRegister PUT /games/{game_id}/entities/robots/{robot_id}/registers/{register} Set Register Content

ClearRegisters

void ClearRegisters (int gameId, int robotId)

clear registers

Emptys all register of the robot

Example

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 ClearRegistersExample
    {
        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 RobotsApi(config);
            var gameId = 56;  // int | The id of the game to interact with
            var robotId = 56;  // int | the id of the robot to interact with

            try
            {
                // clear registers
                apiInstance.ClearRegisters(gameId, robotId);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling RobotsApi.ClearRegisters: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
gameId int The id of the game to interact with
robotId int the id of the robot to interact with

Return type

void (empty response body)

Authorization

player-auth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK -
404 Not Found -

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

ClearUpgrades

void ClearUpgrades (int gameId, int robotId)

Clear Robot Upgrades

Removes all upgrades from a robot

Example

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 ClearUpgradesExample
    {
        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 RobotsApi(config);
            var gameId = 56;  // int | The id of the game to interact with
            var robotId = 56;  // int | the id of the robot to interact with

            try
            {
                // Clear Robot Upgrades
                apiInstance.ClearUpgrades(gameId, robotId);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling RobotsApi.ClearUpgrades: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
gameId int The id of the game to interact with
robotId int the id of the robot to interact with

Return type

void (empty response body)

Authorization

player-auth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK -
404 Not Found -

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

DoEntityAction

void DoEntityAction (int gameId, int robotId, EntityAction entityAction = null)

Add Entity Action to stack

Adds an action to the stack. The stack is processed using first in first out

Example

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 DoEntityActionExample
    {
        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 RobotsApi(config);
            var gameId = 56;  // int | The id of the game to interact with
            var robotId = 56;  // int | the id of the robot to interact with
            var entityAction = new EntityAction(); // EntityAction |  (optional) 

            try
            {
                // Add Entity Action to stack
                apiInstance.DoEntityAction(gameId, robotId, entityAction);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling RobotsApi.DoEntityAction: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
gameId int The id of the game to interact with
robotId int the id of the robot to interact with
entityAction EntityAction [optional]

Return type

void (empty response body)

Authorization

player-auth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK -
404 Not Found -

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

GetActionStack

List<EntityAction> GetActionStack (int gameId, int robotId)

Get Robot action stack

Retuns a list od all actions in the stack

Example

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 GetActionStackExample
    {
        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 RobotsApi(config);
            var gameId = 56;  // int | The id of the game to interact with
            var robotId = 56;  // int | the id of the robot to interact with

            try
            {
                // Get Robot action stack
                List<EntityAction> result = apiInstance.GetActionStack(gameId, robotId);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling RobotsApi.GetActionStack: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
gameId int The id of the game to interact with
robotId int the id of the robot to interact with

Return type

List<EntityAction>

Authorization

player-auth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK -
404 Not Found -

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

GetInstalledUpgrades

List<int> GetInstalledUpgrades (int gameId, int robotId)

Get Robot Upgrades

Returns the upgrades installed on the robot

Example

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 GetInstalledUpgradesExample
    {
        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 RobotsApi(config);
            var gameId = 56;  // int | The id of the game to interact with
            var robotId = 56;  // int | the id of the robot to interact with

            try
            {
                // Get Robot Upgrades
                List<int> result = apiInstance.GetInstalledUpgrades(gameId, robotId);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling RobotsApi.GetInstalledUpgrades: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
gameId int The id of the game to interact with
robotId int the id of the robot to interact with

Return type

List

Authorization

player-auth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK -
404 Not Found -

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

GetPossibleActions

List<EntityEventOportunity> GetPossibleActions (int gameId, int robotId)

Get Aviable actions

Returns a list of EntityActionTypes which are possible to be executed at the moment.

Example

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 GetPossibleActionsExample
    {
        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 RobotsApi(config);
            var gameId = 56;  // int | The id of the game to interact with
            var robotId = 56;  // int | the id of the robot to interact with

            try
            {
                // Get Aviable actions
                List<EntityEventOportunity> result = apiInstance.GetPossibleActions(gameId, robotId);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling RobotsApi.GetPossibleActions: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
gameId int The id of the game to interact with
robotId int the id of the robot to interact with

Return type

List<EntityEventOportunity>

Authorization

player-auth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK -
404 Not Found -

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

GetRegisterContent

RobotCommand GetRegisterContent (int gameId, int robotId, int register)

Get Register Content

Returns the Programming card in the robots register

Example

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 GetRegisterContentExample
    {
        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 RobotsApi(config);
            var gameId = 56;  // int | The id of the game to interact with
            var robotId = 56;  // int | the id of the robot to interact with
            var register = 56;  // int | The number of the register

            try
            {
                // Get Register Content
                RobotCommand result = apiInstance.GetRegisterContent(gameId, robotId, register);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling RobotsApi.GetRegisterContent: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
gameId int The id of the game to interact with
robotId int the id of the robot to interact with
register int The number of the register

Return type

RobotCommand

Authorization

player-auth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK -
404 Not Found -

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

GetRegisters

List<RobotCommand> GetRegisters (int gameId, int robotId)

Get register information

Returns the content of the registers

Example

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 GetRegistersExample
    {
        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 RobotsApi(config);
            var gameId = 56;  // int | The id of the game to interact with
            var robotId = 56;  // int | the id of the robot to interact with

            try
            {
                // Get register information
                List<RobotCommand> result = apiInstance.GetRegisters(gameId, robotId);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling RobotsApi.GetRegisters: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
gameId int The id of the game to interact with
robotId int the id of the robot to interact with

Return type

List<RobotCommand>

Authorization

player-auth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK -
404 Not Found -

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

GetRobotStats

RobotInfo GetRobotStats (int gameId, int robotId)

Get Robot Informations

Returns the status and info about the robot

Example

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 GetRobotStatsExample
    {
        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 RobotsApi(config);
            var gameId = 56;  // int | The id of the game to interact with
            var robotId = 56;  // int | the id of the robot to interact with

            try
            {
                // Get Robot Informations
                RobotInfo result = apiInstance.GetRobotStats(gameId, robotId);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling RobotsApi.GetRobotStats: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
gameId int The id of the game to interact with
robotId int the id of the robot to interact with

Return type

RobotInfo

Authorization

player-auth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK -
404 Not Found -

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

GetRobots

List<int> GetRobots (int gameId)

Get all robots

Returns a list of all robot IDs in this game. > A robot is not a player as a player is able to controll multiple robots

Example

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 GetRobotsExample
    {
        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 RobotsApi(config);
            var gameId = 56;  // int | The id of the game to interact with

            try
            {
                // Get all robots
                List<int> result = apiInstance.GetRobots(gameId);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling RobotsApi.GetRobots: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
gameId int The id of the game to interact with

Return type

List

Authorization

player-auth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK -
404 Not Found -

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

RemoveRobotUpgrade

void RemoveRobotUpgrade (int gameId, int robotId, int? upgrade = null)

Remove Upgrade

Removes a paticular upgrade from the robot

Example

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 RemoveRobotUpgradeExample
    {
        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 RobotsApi(config);
            var gameId = 56;  // int | The id of the game to interact with
            var robotId = 56;  // int | the id of the robot to interact with
            var upgrade = 56;  // int? | The id of the upgrade to remove (optional) 

            try
            {
                // Remove Upgrade
                apiInstance.RemoveRobotUpgrade(gameId, robotId, upgrade);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling RobotsApi.RemoveRobotUpgrade: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
gameId int The id of the game to interact with
robotId int the id of the robot to interact with
upgrade int? The id of the upgrade to remove [optional]

Return type

void (empty response body)

Authorization

player-auth

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 OK -
404 Not Found -

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

SetRegister

void SetRegister (int gameId, int robotId, int register, int statementId)

Set Register Content

Changes the programming card of the robots register

Example

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 SetRegisterExample
    {
        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 RobotsApi(config);
            var gameId = 56;  // int | The id of the game to interact with
            var robotId = 56;  // int | the id of the robot to interact with
            var register = 56;  // int | The number of the register
            var statementId = 56;  // int | The Id of the statement to place here

            try
            {
                // Set Register Content
                apiInstance.SetRegister(gameId, robotId, register, statementId);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling RobotsApi.SetRegister: " + e.Message );
                Debug.Print("Status Code: "+ e.ErrorCode);
                Debug.Print(e.StackTrace);
            }
        }
    }
}

Parameters

Name Type Description Notes
gameId int The id of the game to interact with
robotId int the id of the robot to interact with
register int The number of the register
statementId int The Id of the statement to place here

Return type

void (empty response body)

Authorization

player-auth

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

HTTP response details

Status code Description Response headers
201 Changed -
404 Not Found -

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