Download the PHP package gamebetr/cards without Composer

On this page you can find all versions of the php package gamebetr/cards. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package cards

Cards

The cards package extends the gamebetr/provable package to provide a provably fair way to shuffle and utilize decks of cards.

Installation

Gamebetr\Cards\Deck Object

Initialization

or

Deck Methods

__construct(string $clientSeed = null, string $serverSeed = null, int $deckCount = 1, bool $jokers = false)

$clientSeed - This is the client seed used to generate the provably fair shuffle. The default value of null will cause the Provable class to auto generate a client seed.

$serverSeed - This is the server seed used to generate the provably fair shuffle. The default value of null will cause the Provable class to auto generate a server seed.

$deckCount - This is the amount of card decks to use. The default is 1.

$jokers - This parameter determines whether jokers will be included in the deck. The default is false.

init(string $clientSeed = null, string $serverSeed = null, int $deckCount = 1, bool $jokers = false) : Gamebetr\Cards\Deck

This method is just a static constructor to make it cleaner when instanciating the Deck class. This will return a Deck class.

getProvable() : Gamebetr\Provable\Provable

This method will return the Gamebetr\Provable\Provable instance used to shuffle the deck.

deal() : Gamebetr\Cards\Card

This method will return the top Gamebetr\Cards\Card in the deck.

burn()

This method will burn the top card in the deck.

getCards() : array

This method will return the full, original shuffled values of the deck. The values in this array are the numeric values used to create the Gamebetr\Cards\Card objects.

getRemainingCards() : array

This method will return an array of all remaining Gamebetr\Cards\Card in the deck.

getDealtCards() : array

This method will return an array of all of the dealt Gamebetr\Cards\Card in the deck.

getBurntCards() : array

This method will return an array of all of the burnt Gamebetr\Cards\Card in the deck.

Card Methods

__construct(int $value)

$value - This is the value of the card.

init(int $value) : Card

This method is just a static constructor for the Card object. This will return a Card class.

isJoker() : bool

This method will return true of the Card is a joker.

suit() : int

This method will return an integer representation of the card suit. 0 = clubs, 1 = diamonds, 2 = hearts, 3 = spades.

suitName() : string

This method will return the name of the card suit.

rank() : int

This method will return an integer representation of the card rank. -1 = joker, 0 = 2, 1 = 3, 2 = 4, 3 = 5, 4 = 6, 5 = 7, 6 = 8, 7 = 9, 8 = 10, 9 = jack, 10 = queen, 11 = king, 12 = ace.

rankName() : string

This method will return the name of the card rank.

value() : int

This method will return the integer value for the card. joker = 0, 2-9 = the face value, 10-king = 10, ace = 11.

name() : string

This method is an alias of rankName().

fullName() : string

This method returns the full name of the card (e.g. two of diamonds).

greaterThan(Gamebetr\Cards\Card $card, bool $useSuitValue = false)

This method will compare the card against a different card and return true if the current card is of greater value. By specifying true for the $useSuitValue, it will rank two matching cards by suit.

lessThan(Gamebetr\Cards\Card $card, bool $useSuitValue = false)

This method will compare the card against a different card and return true if the current card is of lesser value. By specifying true for the $useSuitValue, it will rank two matching cards by suit.

equalTo(Gamebetr\Cards\Card $card, bool $useSuitValue = false)

This method will compare the card against a different card and return true if the current card is of the same value. By specifying true for the $useSuitValue, it will rank two matching cards by suit.

compare(Gamebetr\Cards\Card $card, bool $useSuitValue = false)

This method will compare the card against a different card and return -1 if the card is of lesser value, 0 if the cards have the same value, and 1 if the card is of greater value. By specifying true for the $useSuitValue, it will rank two matching cards by suit.

__toString()

This method is an alias of getName().


All versions of cards with dependencies

PHP Build Version
Package Version
Requires php Version >=7.2
ext-intl Version *
gamebetr/provable Version ^1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package gamebetr/cards contains the following files

Loading the files please wait ....