/** * Raw Font API object - should always correspond with the Font Schema * @param id * @param name * @param url * @param parentEntity * @constructor */ GameLib.D3.API.Font = function( id, name, url, parentEntity ) { if (GameLib.Utils.UndefinedOrNull(id)) { id = GameLib.Utils.RandomId(); } this.id = id; if (GameLib.Utils.UndefinedOrNull(name)) { name = 'Font (' + id + ')'; } this.name = name; if (GameLib.Utils.UndefinedOrNull(url)) { url = '/apiRelative/path/to/font'; } this.url = url; if (GameLib.Utils.UndefinedOrNull(parentEntity)){ parentEntity = null; } this.parentEntity = parentEntity; }; GameLib.D3.API.Font.prototype = Object.create(GameLib.Component.prototype); GameLib.D3.API.Font.prototype.constructor = GameLib.D3.API.Font; /** * Returns an API light from an Object light * @param objectFont * @constructor */ GameLib.D3.API.Font.FromObject = function(objectFont) { return new GameLib.D3.API.Font( objectFont.id, objectFont.name, objectFont.url, objectFont.parentEntity ); };