Skip to content

C# SDK for AssistiveCards API, used in unity project, see the website for HTTP API reference.

Notifications You must be signed in to change notification settings

assistivecards/assistivecards-sdk

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AssistiveCards SDK

This is a documentation for the AssistiveCards SDK, this module will be accessible from anywhere in game, C# sdk for assistivecards api

CheckConnectionStatus

Returns an object of type Status which holds information about network connection.

async Task<Status> CheckConnectionStatus()

Example usage;

Status status = new Status();
status = await CheckConnectionStatus();

GetPacks

Takes in a language code of type string and returns an object of type Packs which holds an array of Pack objects in the specified language.

async Task<Packs> GetPacks(string language)

Example usage;

Packs packs = new Packs();
packs = await GetPacks("en");

GetCards

Takes in a language code and a pack slug of type string as parameters. Returns an object of type Cards which holds an array of Card objects in the specified pack and language.

async Task<Cards> GetCards(string language, string packSlug)

Example usage;

Cards cards = new Cards();
cards = await GetCards("en", "animals");

GetActivities

Takes in a language code of type string and returns an object of type Activities which holds an array of Activity objects in the specified language.

async Task<Activities> GetActivities(string language)

Example usage;

Activities activities = new Activities();
activities = await GetActivities("en");

GetLanguages

Returns an object of type Languages which holds an array of Language objects.

async Task<Languages> GetLanguages()

Example usage;

Languges languages = new Languages();
languages = await GetLanguages();

GetPackBySlug

Takes in an object of type Packs as the first parameter and a pack slug of type string as the second parameter. Filters the given array of packs and returns an object of type Pack corresponding to the specified pack slug.

Pack GetPackBySlug(Packs packs, string packSlug)

Example usage;

Pack pack = new Pack();
pack = GetPackBySlug(packs, "animals");

GetCardBySlug

Takes in an object of type Cards as the first parameter and a card slug of type string as the second parameter. Filters the given array of cards and returns an object of type Card corresponding to the specified card slug.

Card GetCardBySlug(Cards cards, string cardSlug)

Example usage;

Card card = new Card();
card = GetCardBySlug(cards, "bee");

GetActivityBySlug

Takes in an object of type Activities as the first parameter and an activity slug of type string as the second parameter. Filters the given array of activities and returns an object of type Activity corresponding to the specified activity slug.

Activity GetActivityBySlug(Activities activities, string slug)

Example usage;

Activity activity = new Activity();
activity = GetActivityBySlug(activities, "practicing-speaking");

GetLanguageByCode

Takes in an object of type Languages as the first parameter and a language code of type string as the second parameter. Filters the given array of languages and returns an object of type Language corresponding to the specified language code.

Language GetLanguageByCode(Languages languages, string languageCode)

Example usage;

Language language = new Language();
language = GetLanguageByCode(languages, "en");

GetPackImage

Takes in a pack slug of type string as the first parameter and an optional image size of type integer as the second parameter. Returns an object of type Texture2D corresponding to the specified pack slug and image size.

Default image size is 256x256

async Task<Texture2D> GetPackImage(string packSlug, int imgSize)

Example usage;

Texture2D texture;
texture = await GetPackImage("animals", 512);

GetCardImage

Takes in a pack slug of type string as the first parameter, a card slug of type string as the second parameter and an optional image size of type integer as the third parameter. Returns an object of type Texture2D corresponding to the specified pack slug, card slug and image size.

Default image size is 256x256

async Task<Texture2D> GetCardImage(string packSlug, string cardSlug, int imgSize)

Example usage;

Texture2D texture;
texture = await GetCardImage("animals", "bee", 512);

GetActivityImage

Takes in an activity slug of type string and returns an object of type Texture2D corresponding to the specified activity slug.

Note that the image size is 1200x800

async Task<Texture2D> GetActivityImage(string activitySlug)

Example usage;

Texture2D texture;
texture = await GetActivityImage("brushing-teeth");

GetAvatarImage

Takes in an avatar ID of type string as the first parameter and an optional image size of type integer as the second parameter. Returns an object of type Texture2D corresponding to the specified avatar ID and image size.

Default image size is 256x256

Note that avatar types have a maximum of 33 assets for the category "boy", 27 assets for the category "girl" and 29 assets for the category "misc".

e.g. boy13, girl23, misc05

async Task<Texture2D> GetAvatarImage(string avatarId, int imgSize)

Example usage;

Texture2D texture;
texture = await GetAvatarImage("girl23",512);

GetApps

Returns an object of type Apps which holds an array of App objects.

async Task<Apps> GetApps()

Example usage;

Apps apps = new Apps();
apps = await GetApps();

GetAppIcon

Takes in an app slug of type string as the first parameter and an optional image size of type integer as the second parameter. Returns an object of type Texture2D corresponding to the specified app slug and image size.

Default image size is 1024x1024

async Task<Texture2D> GetAppIcon(string appSlug, int imgSize)

Example usage;

Texture2D texture;
texture = await GetAppIcon("leeloo",683);

GetGames

Returns an object of type Games which holds a list of Game objects.

Games GetGames()

Example usage;

Games games = new Games();
games = GetGames();

GetGameIcon

Takes in a game slug of type string as the first parameter and an optional image size of type integer as the second parameter. Returns an object of type Texture2D corresponding to the specified game slug and image size.

Default image size is 1024x1024

async Task<Texture2D> GetGameIcon(string gameSlug, int imgSize)

Example usage;

Texture2D texture;
texture = await GetGameIcon("memory",256);

GetCardImagesByPack

Takes in a language code of type string as the first parameter, a pack slug of type string as the second parameter and an optional image size of type integer as the third parameter. Returns an array of Texture2D objects corresponding to the specified language, pack slug and image size.

Default image size is 256x256

async Task<Texture2D[]> GetCardImagesByPack(string languageCode, string packSlug, int imgSize)

Example usage;

Texture2D[] textures;
texture = await GetCardImagesByPack("en", "school", 512);

GetAvatarImagesByCategory

Takes in a category of type string as the first parameter and an optional image size of type integer as the second parameter. Returns an array of Texture2D objects corresponding to the specified category and image size.

Default image size is 256x256

async Task<Texture2D[]> GetAvatarImagesByCategory(string category, int imgSize)

Example usage;

Texture2D[] textures;
texture = await GetAvatarImagesByCategory("misc",512);

About

C# SDK for AssistiveCards API, used in unity project, see the website for HTTP API reference.

Topics

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages