Change datamodel

Hierarchy

  • any
    • ItemChange

Constructors

Properties

updateTime: Date
value: undefined | number

Accessors

Methods

  • Internal

    Safely apply this change to an actor, catching any errors.

    Parameters

    • actor: ActorPF

      The actor to apply the change's data to.

    • Optional targets: string[] = null

      Property paths to target on the actor's data.

    • Optional options: {
          applySourceInfo: undefined | boolean;
      } = {}

      Optional options to change the behavior of this function.

      • applySourceInfo: undefined | boolean

        Whether to add the changes to the actor's source information.

    Returns void

  • Applies this change to an actor.

    Parameters

    • actor: ActorPF

      The actor to apply the change's data to.

    • Optional targets: string[] = null

      Property paths to target on the actor's data.

    • Optional options: {
          applySourceInfo: undefined | boolean;
          rollData: undefined | object;
      } = {}

      Optional options to change the behavior of this function.

      • applySourceInfo: undefined | boolean

        Whether to add the changes to the actor's source information.

      • rollData: undefined | object

        Roll data

    Returns void

  • Applies this change's info to an actor's sourceInfo. Info is only added if either the type | modifier type allows stacking or the value is higher than the previous value. If the modifier type is not stacking and this change's info is added, existing and now ineffective info entries are removed.

    Parameters

    • actor: ActorPF

      The actor to apply the change's data to.

    Returns void

  • Parameters

    • data: object

      Update data

    • options: object = {}

      Additional options

    • context: object = {}

      Update context

    Returns Promise<null | Item>

    • Updated parent, or null if no update was performed (e.g. nothing changed)

    Throws

    • If change has no parent to update or the change does not exist on parent.
  • Creates a change.

    Parameters

    • data: object[]

      Data to initialize the change(s) with.

    • context: {
          parent: undefined | ItemPF;
      } = {}

      An object containing context information.

      • parent: undefined | ItemPF

        The parent entity to create the change within.

    Returns ItemChange[]

    The resulting changes, or an empty array if nothing was created.

  • Returns {
        _id: any;
        continuous: any;
        flavor: any;
        formula: any;
        operator: any;
        priority: any;
        target: any;
        type: any;
        value: any;
    }

    • _id: any
    • continuous: any
    • flavor: any
    • formula: any
    • operator: any
    • priority: any
    • target: any
    • type: any
    • value: any

Generated using TypeDoc