pxt-ev3/libs/core/core.ts

19 lines
362 B
TypeScript
Raw Normal View History

2017-07-10 11:42:30 +01:00
namespace control {
2017-07-11 12:31:34 +02:00
let nextComponentId: number;
2017-07-10 11:37:14 +01: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 11:37:14 +01:00
if (!id) id = ++nextComponentId
this._id = id
}
2017-11-28 16:02:04 -08:00
id() {
2017-07-10 11:37:14 +01:00
return this._id;
}
}
}