Options
All
  • Public
  • Public/Protected
  • All
Menu

The Document definition for an Actor. Defines the DataSchema and common behaviors for an Actor which are shared between both client and server.

mixes

ActorData

memberof

documents

param data

Initial data from which to construct the Actor

param context

Construction context options

Hierarchy

Index

Constructors

Methods

  • _initializeSource(source: any, options: any): any
  • inheritdoc

    Parameters

    • source: any
    • options: any

    Returns any

  • _preCreate(data: any, options: any, user: any): Promise<void>
  • Perform preliminary operations before a Document of this type is created. Pre-creation operations only occur for the client which requested the operation. Modifications to the pending document before it is persisted should be performed with this.updateSource().

    Parameters

    • data: any

      The initial data object provided to the document creation request

    • options: any

      Additional options which modify the creation request

    • user: any

      The User requesting the document creation

    Returns Promise<void>

    A return value of false indicates the creation operation should be cancelled.

  • _preUpdate(changed: any, options: any, user: any): Promise<void>
  • Perform preliminary operations before a Document of this type is updated. Pre-update operations only occur for the client which requested the operation.

    Parameters

    • changed: any

      The differential data that is changed relative to the documents prior values

    • options: any

      Additional options which modify the update request

    • user: any

      The User requesting the document update

    Returns Promise<void>

    A return value of false indicates the update operation should be cancelled.

  • getDefaultArtwork(actorData: ActorData): { img: string; texture: { src: string } }
  • Determine default artwork based on the provided actor data.

    Parameters

    Returns { img: string; texture: { src: string } }

    Candidate actor image and prototype token artwork.

    • img: string
    • texture: { src: string }
      • src: string
  • canUserCreate(user: any): any
  • Test whether a given User has a sufficient role in order to create Documents of this type in general.

    Parameters

    • user: any

      The User being tested

    Returns any

    Does the User have a sufficient role to create?

  • migrateData(data: any): any
  • inheritdoc

    Parameters

    • data: any

    Returns any

  • shimData(data: any, options: any): any
  • inheritdoc

    Parameters

    • data: any
    • options: any

    Returns any

  • Is a user able to create this actor?

    Parameters

    • user: User

      The user attempting the creation operation.

    • doc: Actor

      The Actor being created.

    Returns any

  • #canUpdate(user: User, doc: Actor, data: any): any
  • Is a user able to update an existing actor?

    Parameters

    • user: User

      The user attempting the update operation.

    • doc: Actor

      The Actor being updated.

    • data: any

      The update delta being applied.

    Returns any

Properties

metadata: any = ...

Default metadata which applies to each instance of this Document type.

DEFAULT_ICON: string = CONST.DEFAULT_TOKEN

The default icon used for newly created Actor documents.

Accessors

  • get TYPES(): string[]
  • The allowed set of Actor types which may exist.

    Returns string[]