File

src/lib/myScript/input/generic/components/characterInputComponentAlternate.ts

Extends

AbstractComponent

Constructor

constructor(obj: CharacterInputComponentAlternateParameters)

Methods

getAlternate
getAlternate()

Get alternate

Returns: string
setAlternate
setAlternate(alternate: string)

Set alternate

Parameters :
  • alternate : String
Returns: void
getProbability
getProbability()

Get probability

Returns: number
setProbability
setProbability(probability: number)

Set probability

Parameters :
  • probability : Number
Returns: void
getBoundingBox
getBoundingBox()

Get input component bounding-box

Returns: Rectangle
setBoundingBox
setBoundingBox(boundingBox: Rectangle)

Set input component bounding-box

Parameters :
Returns: void

Properties

alternate
alternate: string
probability
probability: number
import { AbstractComponent } from './abstractComponent';
import { Rectangle } from '../../../common/generic/rectangle';

export interface CharacterInputComponentAlternateParameters {
	alternate?: string,
	probability?: number
}

export class CharacterInputComponentAlternate extends AbstractComponent {
	alternate: string;
	probability: number;

	constructor(obj?: CharacterInputComponentAlternateParameters) {
		super();
		this.type = 'inputCharacter';
		if (obj && obj.alternate) {
			this.alternate = obj.alternate;
		}
		if (obj && obj.probability) {
			this.probability = obj.probability;
		}
	}

	/**
	 * Get alternate
	 *
	 * @method getAlternate
	 * @returns {String}
	 */
	getAlternate(): string {
		return this.alternate;
	};

	/**
	 * Set alternate
	 *
	 * @method setAlternate
	 * @param {String} alternate
	 */
	setAlternate(alternate: string) {
		this.alternate = alternate;
	};

	/**
	 * Get probability
	 *
	 * @method getProbability
	 * @returns {Number}
	 */
	getProbability(): number {
		return this.probability;
	};

	/**
	 * Set probability
	 *
	 * @method setProbability
	 * @param {Number} probability
	 */
	setProbability(probability: number) {
		this.probability = probability;
	};

	/**
	 * Get input component bounding-box
	 *
	 * @method getBoundingBox
	 * @returns {Rectangle}
	 */
	getBoundingBox(): Rectangle {
		throw new Error('not implemented');
	};

	/**
	 * Set input component bounding-box
	 *
	 * @method setBoundingBox
	 * @param {Rectangle} boundingBox
	 */
	setBoundingBox(boundingBox: Rectangle) {
		throw new Error('not implemented');
	};
}

results matching ""

    No results matching ""