game

Playtech.API. game

Methods

# (static) changePlayerFavorites(options) → {Promise.<{status: string}>}

Change player favorites.
Parameters:
Name Type Description
options Object
Properties
Name Type Description
requestType 'add' | 'remove' type of the operation.
gameTypes Array.<string> list of game codes to add to / remove from favorites.
Returns:
Type
Promise.<{status: string}>
Example
Playtech.API.game.changePlayerFavorites({ gameTypes: ['manos'], requestType: 'add' }).then(() => { ... });

# (static) getGamesConfiguration(disableCacheopt) → {Promise.<{Object}>}

Getting games configuration data.
Parameters:
Name Type Attributes Description
disableCache boolean <optional>
if true data will always be taken from server instead of storage
Returns:
{ games: Object[], gameTypes: Object[], basicGameTileLayout: Object, liveGameTileLayout: Object, basicGameInfoLayout: Object, liveGameInfoLayout: Object }
Type
Promise.<{Object}>
Example
Playtech.API.game.getGamesConfiguration(true)
 .then(({ games, gameTypes, basicGameTileLayout, liveGameTileLayout, basicGameInfoLayout, liveGameInfoLayout }) => {...});

# (static) getGamesFeed(feedName, disableCacheopt) → {Promise.<{name: string, gamesFeedCategories: Array.<Object>, gamesGridLayouts: Object.<string, Object>}>}

Getting games feed.
Parameters:
Name Type Attributes Description
feedName string
disableCache boolean <optional>
if true data will always be taken from server instead of storage
Returns:
Type
Promise.<{name: string, gamesFeedCategories: Array.<Object>, gamesGridLayouts: Object.<string, Object>}>
Example
Playtech.API.game.getGamesFeed('design-feed', true).then(() => { ... });

# (static) getOldGamesFeeds(disableCacheopt) → {Promise.<Array.<feed>>}

Getting all old games feeds.
Parameters:
Name Type Attributes Description
disableCache boolean <optional>
if true data will always be taken from server instead of storage
Deprecated:
  • Yes
Returns:
{ name: string, categories: { cid: string, name: string, gameCodes: string[], roundIcon: string, pgg2: { enabled: boolean, maxGames: number, minGames: number, }, displayName: string, displayNameShort: string }[], active: boolean, translationKeyPrefixMob: string }
Type
Promise.<Array.<feed>>
Example
Playtech.API.game.getOldGamesFeeds(true).then(() => { ... });

# (static) getPlayerFavorites(options) → {Promise.<{favoriteGames: Array.<string>}>}

Return player favorites.
Parameters:
Name Type Description
options Object
Properties
Name Type Description
requestedFavorites Array.<string> list of supported favorites. only 'games' is supported for now.
Deprecated:
  • Yes
Returns:
Type
Promise.<{favoriteGames: Array.<string>}>
Example
Playtech.API.game.getPlayerFavorites({ requestedFavorites: ['games'] }).then(() => { ... });

# (static) open(options)

Open a game according to launch configuration of its game type, if it exists. Otherwise, do nothing.
Parameters:
Name Type Description
options Object
Properties
Name Type Attributes Default Description
code string game code
mode number <optional>
1 mode
Example
Playtech.API.game.open({ code: 'gameCode' });

# (static) setExcludedGameCodes(options) → {void}

Set the list of excluded game codes.
Parameters:
Name Type Description
options Object
Properties
Name Type Description
excludedGameCodes Array.<string> list of game codes to exclude from the whole Portal (except dynamic categories).
Returns:
Type
void
Example
Playtech.API.game.setExcludedGameCodes({ excludedGameCodes: ['manos'] });