constructor(x, y, gid, tileset) {
		let width;
		let height;

		// call the parent constructor
		super();

		// determine the tile size
		if (tileset.isCollection) {
			const image = tileset.getTileImage(gid & TMX_CLEAR_BIT_MASK);
			width = image.width;
			height = image.height;
		} else {
			width = tileset.tilewidth;
			height = tileset.tileheight;
		}

		this.setMinMax(0, 0, width, height);

		/**
		 * tileset
		 * @type {TMXTileset}
		 */
		this.tileset = tileset;

		/**
		 * the tile transformation matrix (if defined)
		 * @ignore
		 */
		this.currentTransform = null;

		// Tile col / row pos
		this.col = x;
		this.row = y;

		/**
		 * tileId
		 * @type {number}
		 */
		this.tileId = gid;

		/**
		 * True if the tile is flipped horizontally
		 * @type {boolean}
		 */
		this.flippedX = (this.tileId & TMX_FLIP_H) !== 0;

		/**
		 * True if the tile is flipped vertically
		 * @type {boolean}
		 */
		this.flippedY = (this.tileId & TMX_FLIP_V) !== 0;

		/**
		 * True if the tile is flipped anti-diagonally
		 * @type {boolean}
		 */
		this.flippedAD = (this.tileId & TMX_FLIP_AD) !== 0;

		/**
		 * Global flag that indicates if the tile is flipped
		 * @type {boolean}
		 */
		this.flipped = this.flippedX || this.flippedY || this.flippedAD;

		// create and apply transformation matrix if required
		if (this.flipped === true) {
			if (this.currentTransform === null) {
				this.currentTransform = new Matrix2d();
			}
			this.setTileTransform(this.currentTransform.identity());
		}

		// clear out the flags and set the tileId
		this.tileId &= TMX_CLEAR_BIT_MASK;
	}
@param {number} x - x index of the Tile in the map
@param {number} y - y index of the Tile in the map
@param {number} gid - tile gid
@param {TMXTileset} tileset - the corresponding tileset object