pxt-ev3/libs/core/core.ts

19 lines
365 B
TypeScript
Raw Normal View History

2017-07-10 12:42:30 +02:00
namespace control {
2017-07-11 12:31:34 +02:00
let nextComponentId: number;
2017-07-10 12:37:14 +02:00
export class Component {
protected _id: number;
constructor(id = 0) {
2017-07-11 12:31:34 +02:00
if (!nextComponentId)
nextComponentId = 20000
2017-07-10 12:37:14 +02:00
if (!id) id = ++nextComponentId
this._id = id
}
getId() {
return this._id;
}
}
}