Options
All
  • Public
  • Public/Protected
  • All
Menu

Represents the Parcel instance.

Hierarchy

  • AbstractParcel

Index

Constructors

Properties

address?: string
featuresList: Feature[]

A list of all the Feature objects in the parcel

fetchSnapshots: (callback?: (snapshots: Snapshot[]) => void) => void = ...

Type declaration

    • (callback?: (snapshots: Snapshot[]) => void): void
    • Throttled function to fetch the snapshots of the parcel;

      Parameters

      • Optional callback: (snapshots: Snapshot[]) => void

        a Callback expecting an array of objects. Eg:

        function myCallback(snapshots){
        parcel.setSnapshot(snapshots[0].id)
        }

        feature.on('click',e=>{
        parcel.fetchSnapshots(myCallback)
        })

      Returns void

owner: string = ""

Owner of the parcel

players: Map<string, Player>

A Map of all the players connected to the parcel; <token -> player>

setSnapshot: (snapshot_id: number) => void = ...

Type declaration

    • (snapshot_id: number): void
    • Sets the parcel content to the given snapshot index. This should be called after 'fetchSnaphots' has been called.

      Parameters

      • snapshot_id: number

      Returns void

snapshots: Snapshot[]

A list of all the snapshots of the parcel; Is empty until fetchSnapshots() is called.

x1: number
x2: number
y1: number
y2: number
z1: number
z2: number

Accessors

  • get allowLoggedInOnly(): boolean
  • set allowLoggedInOnly(state: boolean): void
  • get allowedWallets(): string[]
  • get isPrivate(): boolean
  • set isPrivate(state: boolean): void
  • get summary(): { contributors?: string[]; features?: FeatureDescription[]; id: string | number; palette?: string[]; tileset?: string; voxels?: string }
  • Returns a summary of the parcel

    Returns { contributors?: string[]; features?: FeatureDescription[]; id: string | number; palette?: string[]; tileset?: string; voxels?: string }

    the properties of the parcel object.

    • Optional contributors?: string[]
    • Optional features?: FeatureDescription[]
    • id: string | number
    • Optional palette?: string[]
    • Optional tileset?: string
    • Optional voxels?: string

Methods

  • allow(walletOrWallets: string | string[]): void
  • Parameters

    • walletOrWallets: string | string[]

    Returns void

  • debug(): void
  • disallow(wallet: string): void
  • fetch(): void
  • getFeatureById(id: string): undefined | Feature
  • Get a feature by its ID

    Parameters

    • id: string

      the feature's ID

    Returns undefined | Feature

    a Feature or undefined

  • getFeatureByUuid(uuid: string): undefined | Feature
  • Get a feature by its UUID

    Parameters

    • uuid: string

      the feature's UUID

    Returns undefined | Feature

    a Feature or Undefined

  • getFeaturesByType(type: string): Feature[]
  • getPlayerByUuid(uuid: string): undefined | Player
  • Get a player by its UUID

    Parameters

    • uuid: string

      a string

    Returns undefined | Player

    a Player or Undefined

  • getPlayerByWallet(wallet: string): undefined | null | Player
  • Get a player by its wallet

    Parameters

    • wallet: string

      the player's wallet

    Returns undefined | null | Player

    a Player object or undefined

  • getPlayersWithinParcel(): Player[]
  • Get a list of all players that are within the parcel A player within the parcel is player that's sent the event 'playerenter'

    Returns Player[]

  • isWalletAllowedIfPrivate(wallet?: string): boolean
  • Parameters

    • Optional wallet: string

    Returns boolean

  • removeFeature(f: Feature, shouldBroadcast?: boolean): void
  • Deletes a feature and removes it from the parcel

    Parameters

    Returns void

  • start(): void

Generated using TypeDoc