Skip to content

Latest commit

 

History

History
244 lines (189 loc) · 6.77 KB

MapApi.md

File metadata and controls

244 lines (189 loc) · 6.77 KB

Tgm.Roborally.Api.Api.MapApi

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

Method HTTP request Description
GetGameMap GET /games/{game_id}/map Get Map
GetMapInfo GET /games/{game_id}/map/info Get Map info
GetTile GET /games/{game_id}/map/tiles/{x}/{y} Get tile

GetGameMap

Map GetGameMap (int gameId)

Get Map

Returns the map of this specific game including the tiles (data)

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

            try
            {
                // Get Map
                Map result = apiInstance.GetGameMap(gameId);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling MapApi.GetGameMap: " + 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

Map

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 -
500 Internal Server Error -

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

GetMapInfo

MapInfo GetMapInfo (int gameId)

Get Map info

Get meta information abouzt the map of the game

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

            try
            {
                // Get Map info
                MapInfo result = apiInstance.GetMapInfo(gameId);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling MapApi.GetMapInfo: " + 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

MapInfo

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]

GetTile

Tile GetTile (int gameId, int x, int y)

Get tile

Inspect a tile of the map

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 GetTileExample
    {
        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 MapApi(config);
            var gameId = 56;  // int | The id of the game to interact with
            var x = 56;  // int | The x codinate of the tile
            var y = 56;  // int | The y codinate of the tile

            try
            {
                // Get tile
                Tile result = apiInstance.GetTile(gameId, x, y);
                Debug.WriteLine(result);
            }
            catch (ApiException  e)
            {
                Debug.Print("Exception when calling MapApi.GetTile: " + 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
x int The x codinate of the tile
y int The y codinate of the tile

Return type

Tile

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]