CardcastSharp is a C# api wrapper for the Cardcastgame.com API.
If you're lazy and don't want to bother reading the docs, head over to the releases page. UPDATE: this is a single file library. Modify it to work with the language version you're using and just shove it into your project. I won't be uploading builds for this anymore.
The Cardcast API is simple by nature. This wrapper is equally simple.
Don't forget to
using CardcastSharp;
To get a deck:
Deck d = await Cardcast.GetDeck("4KU68", OnGetDeckError);
if(d != null)
{
// Do stuff
}
private void OnGetDeckError(Exception error)
{
// Handle error here
}
Passing a callback to the GetDeck() function allows some shit to be done if something fucks up internally.
Getting the cards in the deck:
Deck d = await Cardcast.GetDeck("4KU68", OnGetDeckError);
if(d != null)
{
foreach(Card c in d.Calls)
{
// Do something with all the calls (black cards) in the deck
}
foreach(Card c in d.Responses)
{
// Do something with all the responses (white cards) in the deck
}
}
Getting information for a deck:
Deck d = await Cardcast.GetDeck("4KU68", OnGetDeckError);
if(d != null)
{
d.Info // Contains lots of information about the deck
}
// Alternate method
DeckInfo di = await Cardcast.GetDeckInfo("4KU68", OnGetDeckError);
if(di != null)
{
di.Author // Lots of properties in here
}
Just don't be a dick.
Neither FEAR Labs or myself owns Cardcast. This is simply a wrapper for their cool thing.