39 lines
842 B
JavaScript
39 lines
842 B
JavaScript
|
/**
|
||
|
* Selected Objects
|
||
|
* @param graphics GameLib.D3.Graphics
|
||
|
* @param object
|
||
|
* @param helper
|
||
|
* @param lastUpdate
|
||
|
* @constructor
|
||
|
*/
|
||
|
GameLib.D3.SelectedObject = function SelectedObject(
|
||
|
graphics,
|
||
|
object,
|
||
|
helper,
|
||
|
lastUpdate
|
||
|
) {
|
||
|
this.graphics = graphics;
|
||
|
this.graphics.isNotThreeThrow();
|
||
|
|
||
|
if (GameLib.Utils.UndefinedOrNull(object)) {
|
||
|
console.warn('Cannot select no object');
|
||
|
throw new Error('Cannot select no object');
|
||
|
}
|
||
|
this.object = object;
|
||
|
|
||
|
if (GameLib.Utils.UndefinedOrNull(helper)) {
|
||
|
helper = new GameLib.D3.Helper(
|
||
|
this.graphics,
|
||
|
null,
|
||
|
null,
|
||
|
object
|
||
|
)
|
||
|
}
|
||
|
this.helper = helper;
|
||
|
|
||
|
if (GameLib.Utils.UndefinedOrNull(lastUpdate)) {
|
||
|
lastUpdate = Date.now();
|
||
|
}
|
||
|
this.lastUpdate = lastUpdate;
|
||
|
};
|