Module: util

Methods

(static) areCardsEqual(card1, card2) → {boolean}

Determines if two different card objects represent the same card
Parameters:
Name Type Description
card1 Types.Card card to compare
card2 Types.Card card to compare
Source:
Returns:
true if the two cards represent the same card (i.e., same values); false otherwise
Type
boolean

(static) getCardURLFromName(suite, number) → {string}

Determines the appropriate path to the asset for a card face image associated to a particular card
Parameters:
Name Type Description
suite string suite of target card
number string | number number of target card
Source:
Returns:
path to image asset associated to the given suite and number
Type
string

(static) getCurrentRoundState(gameState) → {Types.RoundState}

Finds the most recent round state associated to a given game
Parameters:
Name Type Description
gameState Types.GameState game state being targeted
Source:
Returns:
state of current/most recent round
Type
Types.RoundState

(static) getRandFromArr(arr) → {A}

Picks a random item from an array
Parameters:
Name Type Description
arr Array.<A> list of items
Source:
Returns:
random item from list
Type
A

(static) getWorldEventInfo(worldEventName) → {Object}

Gets world event information associated to the name
Parameters:
Name Type Description
worldEventName string value of WORLD_EVENTS enum
Source:
Returns:
object containing information associated to the world event
Type
Object