UNPKG

marga

Version:
33 lines (32 loc) 1.05 kB
import Entity from '../../entity/Entity'; import IEntity from '../../entity/IEntity'; import IRoad from '../IRoad'; /** * Bead road. This is the most basic road and have no streaks. It is implemented with a set which can guarantee that there are no repeated entities. */ declare class BeadRoad implements IRoad { private _set; private _firstEntity; private _lastEntity; private readonly _shoeIndex; private _entityIndex; private _setLastEntity; private _setFirstEntity; constructor(index: number); print(): string[] | string[][]; getFirstEntity(): IEntity | undefined; getLastEntity(): IEntity | undefined; getShoeIndex(): number; /** * Add entity to the bead road. * @param {Entity} entity * @return {boolean} True if the entity was added, false if it was not */ addEntity(entity: Entity): boolean; /** * The number of entities in the road. * @return {number} The number of entities in the road */ getSize(): number; } export default BeadRoad;