r3-legacy/src/r3-api-clock.js

48 lines
913 B
JavaScript

/**
* Raw Clock API object - should always correspond with the Clock Schema
* @constructor
* @param id
* @param name
* @param parentEntity
*/
R3.API.Clock = function(
id,
name,
parentEntity
) {
if (R3.Utils.UndefinedOrNull(id)) {
id = R3.Utils.RandomId();
}
this.id = id;
if (R3.Utils.UndefinedOrNull(name)) {
name = 'Clock (' + this.id + ')';
}
this.name = name;
R3.API.Component.call(
this,
R3.Component.CLOCK,
parentEntity
);
};
R3.API.Clock.prototype = Object.create(R3.API.Component.prototype);
R3.API.Clock.prototype.constructor = R3.API.Clock;
/**
* Creates an API camera from an Object camera
* @param objectClock
* @constructor
*/
R3.API.Clock.FromObject = function(objectClock) {
return new R3.API.Clock(
objectClock.id,
objectClock.name,
objectClock.parentEntity
);
};