import { Utils } from '../common/Utils'
import { BaseLine } from './BaseLine';

/**
 * PixelLine - 像素线
 * 
 * 一个像素宽度的线,性能很好,不支持调节宽度。
 * 
 * @class PixelLine
 * @memberof THING
 * @extends THING.BaseLine
 * @public
 * 
 * @example
 * const line = new THING.PixelLine({
 *   points: [[0, 0, 0], [10, 0, 0]],
 *   style: { color: '#00ff00' },
 * });
 */
class PixelLine extends BaseLine {

	static defaultTagArray = ['Line'];

	/**
	 * 构造函数
	 * @param {object} param 初始化参数
	 * @param {Array<number[]>} param.points 路径坐标的数组
	 * @param {boolean} [param.uvScroll=false] 是否开启贴图流动
	 * @param {number[]} [param.uvScrollSpeed=[1,0]] 贴图流动速度
	 * @param {object} [param.style] 线样式
	 * @constructor
	 * @public
	 */
	constructor(param = {}) {
		super(param);
	}

	// #region Overrides


	onCreateBodyNode(param) {
		const node = Utils.createObject('PixelLine', { app: this.app });
		return node;
	}

	// #endregion

	// #region Accessor

	// #endregion

	/**
	 * Check whether it's PixelLine type or inherit from it.
	 * @type {boolean}
	 */
	get isPixelLine() {
		return true;
	}

}

export { PixelLine }