41 lines
1.1 KiB
Plaintext
41 lines
1.1 KiB
Plaintext
//This file is generated. Do not edit directly
|
|
|
|
import "luxe: assets" for Assets, Strings
|
|
import "luxe: blocks" for Block
|
|
|
|
|
|
class AssetType {
|
|
static prototype { "luxe: type/prototype.asset" }
|
|
}
|
|
|
|
class AssetGetAPI {
|
|
construct new() {}
|
|
}
|
|
var AssetGet = AssetGetAPI.new()
|
|
|
|
class AssetAddAPI {
|
|
construct new() {}
|
|
}
|
|
var AssetAdd = AssetAddAPI.new()
|
|
|
|
class Asset {
|
|
#hidden
|
|
static add(type_id: String, asset_id: String) {
|
|
var block = Assets.get_block(type_id)
|
|
if(!Block.valid(block)) return null
|
|
var inst = Block.add(block, Strings.add(asset_id))
|
|
return Block.instance(block, inst)
|
|
}
|
|
#hidden
|
|
static instance(type_id: String, asset_id: String) {
|
|
var block = Assets.get_block(type_id)
|
|
if(!Block.valid(block)) return null
|
|
var inst = Block.get(block, Strings.add(asset_id))
|
|
return Block.instance(block, inst)
|
|
}
|
|
static get : AssetGetAPI { AssetGet }
|
|
static add : AssetAddAPI { AssetAdd }
|
|
#asset_type(arg = "asset_id", subtype= "prototype")
|
|
static prototype(asset_id: String) : Num { Assets.get_handle(AssetType.prototype, asset_id) }
|
|
}
|