Giter VIP home page Giter VIP logo

magic-tcg-sdk-kotlin's Introduction

magic-tcg-sdk-kotlin

Unofficial alternative Kotlin wrapper for the Magic: The Gathering - Developers API.

Usage

Cards, Sets

val mtg = Mtg()

// Obtain all possible cards and sets.
val cards = mtg.card().all()

val sets = mtg.set().all()

Along with RxJava3 and querying support, with relevant query fields in CardQueryBuilder.kt and CardSetQueryBuilder.kt.

RxJava3

val mtg = Mtg()

// RxJava3 Card Subscription
mtg.card().observeAll()
	.subscribe({ cards ->
		// ...
	}, { t -> 
		// Some error...
	})
  
// RxJava3 Set Subscription
mtg.set().observeAll()
	.subscribe({ sets ->
		// ...
	}, { t -> 
		// Some error...
	})

Queries

val mtg = Mtg()

// Card Queries
val cards = mtg.card()
        .where {
            rarity = "Mythic Rare"
            
            // Alternatively "Instant|Sorcery|Artifact"
            types = "Instant" or "Sorcery" or "Artifact" 
            ...
        }
        .all() // or .observeAll() for RxJava3
        
val sets = mtg.set()
        .where {
            name = "Khans of Tarkir"
            type = "expansion"
            ...
        }
        .all() // or .observeAll() for RxJava3

Types

val mtg = Mtg()

// Obtain all possible types, subtypes, and supertypes.

// Types: Artifact, Conspiracy, Creature...
val types = mtg.types().all()

// SubTypes: Advisor, Anjani, Alara... 
val subtypes = mtg.subTypes().all()

// SuperTypes: Basic, Legendary, Ongoing...
val supertypes = mtg.superTypes().all()

magic-tcg-sdk-kotlin's People

Contributors

aaryaahmed56 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.