Options
All
  • Public
  • Public/Protected
  • All
Menu
since

1.5

Hierarchy

  • WangSet

Index

Constructors

constructor

Properties

colorCount

colorCount: number

The number of colors used by this Wang set.

imageTile

imageTile: Tile

The tile used to represent the Wang set.

name

name: string

Name of the Wang set.

Readonly tileset

tileset: Tileset

The tileset to which this Wang set belongs.

type

type: typeof Edge | typeof Corner | typeof Mixed

Type of the Wang set.

Static Readonly Corner

Corner: typeof Corner

Static Readonly Edge

Edge: typeof Edge

Static Readonly Mixed

Mixed: typeof Mixed

Methods

setWangId

  • setWangId(tile: Tile, wangId: number[]): void
  • Sets the Wang ID associated with the given tile.

    The Wang ID is given by an array of 8 numbers, indicating the colors associated with each index in the following order: [Top, TopRight, Right, BottomRight, Bottom, BottomLeft, Left, TopLeft]. A value of 0 indicates that no color is associated with a given index.

    Make sure the Wang set color count is set before calling this function, because it will raise an error when the Wang ID refers to non-existing colors.

wangId

  • wangId(tile: Tile): number[]
  • Returns the current Wang ID associated with the given tile.

    The Wang ID is given by an array of 8 numbers, indicating the colors associated with each index in the following order: [Top, TopRight, Right, BottomRight, Bottom, BottomLeft, Left, TopLeft]. A value of 0 indicates that no color is associated with a given index.

Generated using TypeDoc