Class PlayerNameGenerator

Generates a name based on the provided configuration. The configuration includes the minimum and maximum number of phrases that compose the name as well as an array of phrase providers. A different phrase provider can be used for each ordinal phrase allowing different lists for the first phrase, second phrase, etc. A phrase may be only one word long.

Hierarchy

  • PlayerNameGenerator

Index

Constructors

constructor

Methods

getFromHash

  • getFromHash(hash: Buffer): string
  • Create a player name using the supplied hash buffer.

    Parameters

    • hash: Buffer

      Generates a name from the supplied buffer which should contain a 32 byte hash of (such as SHA 256) of player's identity.

    Returns string

getFromId

  • getFromId(id: string | number): string
  • Generates a consistant name given an ID. This method works by taking a hash of the provided ID and call the getFromHash() method.

    Parameters

    • id: string | number

      Identity to generate a constant name from.

    Returns string

getRandom

  • getRandom(): string
Brought to you with ❤ by the Alexa Games team at Amazon. © 2019, Amazon.com, Inc. or its affiliates. All Rights Reserved.