Options
All
  • Public
  • Public/Protected
  • All
Menu

Class MyPlayer

Hierarchy

Index

Constructors

  • new MyPlayer(playerState?: Partial<PlayerState>, fields: ModelField[], playerAdapter: AbstractPlayerAdapter, gs: GameScore, updatePlayerData: ((data: Record<string, string>) => void)): MyPlayer
  • Parameters

    • playerState: Partial<PlayerState> = {}
    • fields: ModelField[]
    • playerAdapter: AbstractPlayerAdapter
    • gs: GameScore
    • updatePlayerData: ((data: Record<string, string>) => void)
        • (data: Record<string, string>): void
        • Parameters

          • data: Record<string, string>

          Returns void

    Returns MyPlayer

Properties

#load: (() => Promise<void>) = ...

Type declaration

    • (): Promise<void>
    • Returns Promise<void>

#platformData: any = {}
#secretCode: string = ''
#sync: ((__namedParameters?: { override?: boolean; silent?: boolean }) => Promise<void>) = ...

Type declaration

    • (__namedParameters?: { override?: boolean; silent?: boolean }): Promise<void>
    • Parameters

      • __namedParameters: { override?: boolean; silent?: boolean } = {}
        • Optional override?: boolean
        • Optional silent?: boolean

      Returns Promise<void>

#updatePlayerData: ((data: Record<string, string>) => void)

Type declaration

    • (data: Record<string, string>): void
    • Parameters

      • data: Record<string, string>

      Returns void

_events: EventLite = ...
_hasFirstSync: boolean = false
fields: ModelField[]
hasAnyCredentials: boolean = false
isLoggedIn: boolean = false
isLoggedInByPlatform: boolean = false
ready: Promise<void>
secretCode: string = ''
tempSecredCode: string = ''

Accessors

  • get _authInfo(): any
  • get _isRequredAvatarUpdate(): boolean
  • get _isRequredDataUpdate(): boolean
  • get avatar(): string
  • set avatar(value: string): void
  • get id(): number
  • get isStub(): boolean
  • get name(): string
  • set name(value: string): void
  • get score(): number
  • set score(value: number): void

Methods

  • _initContext(): Promise<void>
  • add(key: string, value: string | number | boolean): void
  • checkLoggedIn(playerState: PlayerState): Promise<void>
  • fetchFields(): Promise<void>
  • fromJSON(state: Partial<PlayerState>): void
  • get(key: string): string | number | boolean
  • getField(key: string): ModelField
  • getFieldName(key: string): string
  • getFieldVariantName(key: string, value: string | number): string
  • has(key: string): boolean
  • load(): Promise<void>
  • login(): Promise<void>
  • off<ET>(type: ET, handler: ((event: MyPlayerEvents[ET]) => void)): void
  • on<ET>(type: ET, handler: ((event: MyPlayerEvents[ET]) => void)): void
  • once<ET>(type: ET, handler: ((event: MyPlayerEvents[ET]) => void)): void
  • remove(): void
  • reset(): void
  • set(key: string, value: string | number | boolean): void
  • setSecretCode(secretCode: string): void
  • sync(opts?: { override?: boolean; silent?: boolean }): Promise<void>
  • Parameters

    • opts: { override?: boolean; silent?: boolean } = {}
      • Optional override?: boolean
      • Optional silent?: boolean

    Returns Promise<void>

  • toJSON(): PlayerState
  • toggle(key: string): void

Generated using TypeDoc