Coder Social home page Coder Social logo

fifa-ultimate-team-2013-toolkit's Introduction

Sample usage

Login

var loginRequest = new LoginRequest();
await loginRequest.LoginAsync("e-mail", "password", "secret answer");

Player search

All the search parameters are optional. If none are specified, you will get the 1st page of results with no filters applied.

var searchRequest = new SearchRequest();
var searchParameters = new PlayerSearchParameters
{
    Page = 1,
    Level = Level.Gold,
    Formation = Formation.FourThreeThree,
    League = League.BarclaysPremierLeague,
    Nation = Nation.Norway,
    Position = Position.Striker,
    Team = Team.ManchesterUnited
};

var searchResponse = await searchRequest.SearchAsync(searchParameters);
foreach (var auctionInfo in searchResponse.AuctionInfo)
{
	// Handle auction data
}

Trade status

Retrieves the trade statuses of the auctions of interest.

var tradeRequest = new TradeRequest();
var auctionResponse = await tradeRequest.GetTradeStatuses(
    Auctions // Contains the auctions we're currently watching
    .Where(model => model.AuctionInfo.Expires != -1)
    .Select(model => model.AuctionInfo.TradeId));

foreach (var auctionInfo in auctionResponse.AuctionInfo)
{
	// Handle the update auction data
}

Place bids

Passing the amount explicitly:

var bidRequest = new BidRequest();
var bidResponse = await bidRequest.PlaceBid(auctionInfo, 100);

Place the next valid bid amount:

var bidRequest = new BidRequest();
var bidResponse = await bidRequest.PlaceBid(auctionInfo, auctionInfo.CalculateBid());

Player image

  • Format: PNG
  • Dimensions: 100 x 100 pixels
var playerImageRequest = new PlayerImageRequest();
var imageBytes = await playerImageRequest.GetImageAsync(auctionInfo.ItemData.ResourceId);

Item data

Contains info such as name, ratings etc.

var itemRequest = new ItemRequest();
var item = await itemRequest.GetItemAsync(auctionInfo.ItemData.ResourceId);

Available parameter values

Handy if you want to present all the options in the client application, for instance in a drop-down list.

Mapping all these values will be an ongoing process, wouldn't mind some pull requests as help.

Levels

This is an enum, use as is.

Formations

IEnumerable<Formation> formations = Formation.GetAll();

Leagues

IEnumerable<League> leagues = League.GetAll();

Nations

IEnumerable<Nation> nations = Nation.GetAll();

Positions

IEnumerable<Position> positions = Position.GetAll();

Teams

IEnumerable<Team> teams = Team.GetAll();

Extension methods

Automatically calculates the next valid bid amount:

auctionInfo.CalculateBid();

Handy if you want to download the player images, item data etc. from the EA servers. The ItemRequest class uses this method internally.

auctionInfo.ItemData.ResourceId.CalculateBaseId();

fifa-ultimate-team-2013-toolkit's People

Contributors

trydis avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.