spine-module/modifiers/spine_renderer.modifier.wren
2021-07-10 19:43:40 +02:00

473 lines
10 KiB
Text

//-- this file is generated! don't try editing it.
import "luxe: io" for IO
import "luxe: bytes" for Byter, Bytes
import "luxe: world" for Block
//`modifiers/spine_renderer > runtime` types
class ModifierRuntime {
construct new() {
} //new
} //ModifierRuntime
//`modifiers/spine_renderer > runtime` compilers
class ModifierRuntimeCompiler {
construct new() {
}
bytes_count(instance) {
var size = 4 //version
size = size + 0
return size
} //bytes_count
validate(from_source_id, elements) {
var fields = {
"type": false, //:luxe:internal
"uuid": false, //:luxe:internal
"luxe.self.modifier": false, //:luxe:internal
}
for(element in elements) {
var instance = element.value
for(field in instance) {
if(fields[field.key] == null) {
Fiber.abort("node `%(element.key)` in `%(from_source_id)` has extra field `%(field.key)`")
} //if not found
} //each field
for(field in fields) {
var required = field.value
if(required && instance[field.key] == null) {
Fiber.abort("node `%(element.key)` in `%(from_source_id)` is missing a required field `%(field.key)` (and the field has no default value)")
}
} //each field
} //each element
} //validate
write(compiler, instance, out) {
//version
out.write_int32(0)
return out
} //write
bytes_count_block() {
return 8
} //bytes_count_block
write_block(compiler, out) {
//source id
out.write_uint32(compiler.string.hash("modifiers/spine_renderer > runtime"))
//fields count
out.write_int32(0)
} //write_block
write(instance) {
var size = bytes_count(instance)
var out = Byter.new(size+8)
out.write_string("LUXEMRTM")
write(instance, out)
return out
} //write
} //ModifierRuntimeCompiler
//`modifiers/spine_renderer > runtime` block types
class BlockModifierRuntime {
field { "spine_renderer" }
source { "modifiers/spine_renderer > runtime" }
construct new(block) {
_block = block
_inst_type = instance_type
_inst = _inst_type.new(_block, 0)
}
construct new() {
_block = Block.create()
_inst_type = instance_type
_inst = _inst_type.new(_block, 0)
Block.set_type(_block, "modifiers/spine_renderer > runtime")
} //new
instance_type {
class BlockInstModifierRuntime {
slot { _slot }
entity { Block.get_handle(_block, _slot) }
block_set_slot(value) {
_slot=value
return this
}
construct new(block, slot) {
_block = block
_slot = slot
} //new
block { _block }
} //BlockInstModifierRuntime
return BlockInstModifierRuntime
} //instance_type
block { _block }
count { Block.get_count(_block) }
add() { Block.add(_block) }
append(other_block) { Block.append(_block, other_block) }
each(c, fn) {
for(i in 0 ... c) {
fn.call(0, _inst.block_set_slot(i))
}
} //each
[slot, inst] { _inst.block_set_slot(slot) }
[slot] { _inst_type.new(_block, slot) }
} //BlockModifierRuntime
//`modifiers/spine_renderer > data` types
class ModifierData {
construct new() {
_asset = ""
} //new
asset { _asset }
asset=(vvv) { _asset = vvv }
} //ModifierData
//`modifiers/spine_renderer > data` compilers
class ModifierDataCompiler {
construct new() {
}
bytes_count(instance) {
var size = 4 //version
size = size + 4 //asset length
var asset = instance["asset"]
if(asset == null) asset = ""
var asset_len = asset.bytes.count
var asset_size = asset_len + Bytes.padding(asset_len)
size = size + asset_size
size = size + 0
return size
} //bytes_count
validate(from_source_id, elements) {
var fields = {
"type": false, //:luxe:internal
"uuid": false, //:luxe:internal
"luxe.self.modifier": false, //:luxe:internal
"asset": false,
}
for(element in elements) {
var instance = element.value
for(field in instance) {
if(fields[field.key] == null) {
Fiber.abort("node `%(element.key)` in `%(from_source_id)` has extra field `%(field.key)`")
} //if not found
} //each field
for(field in fields) {
var required = field.value
if(required && instance[field.key] == null) {
Fiber.abort("node `%(element.key)` in `%(from_source_id)` is missing a required field `%(field.key)` (and the field has no default value)")
}
} //each field
} //each element
} //validate
write(compiler, instance, out) {
//version
out.write_int32(0)
var asset = instance["asset"]
if(asset == null) asset = ""
out.write_int32(asset.bytes.count)
out.write_string_aligned4(asset)
return out
} //write
bytes_count_block() {
return 16
} //bytes_count_block
write_block(compiler, out) {
//source id
out.write_uint32(compiler.string.hash("modifiers/spine_renderer > data"))
//fields count
out.write_int32(1)
// asset
out.write_uint32(compiler.string.hash("asset"))
out.write_uint32(398550328) //type string
var asset_default = ""
out.write_int32(asset_default.bytes.count)
out.write_string_aligned4(asset_default)
} //write_block
write(instance) {
var size = bytes_count(instance)
var out = Byter.new(size+8)
out.write_string("LUXEMDTA")
write(instance, out)
return out
} //write
} //ModifierDataCompiler
//`modifiers/spine_renderer > data` block types
class BlockModifierData {
field { "spine_renderer" }
source { "modifiers/spine_renderer > data" }
construct new(block) {
_block = block
_inst_type = instance_type
_inst = _inst_type.new(_block, 0)
}
construct new() {
_block = Block.create()
_inst_type = instance_type
_inst = _inst_type.new(_block, 0)
Block.add(_block, "asset", "string", "")
Block.set_type(_block, "modifiers/spine_renderer > data")
} //new
instance_type {
class BlockInstModifierData {
asset { Block.get(_block, "asset", _slot) }
asset=(v) { Block.set(_block, "asset", _slot, v) }
slot { _slot }
entity { Block.get_handle(_block, _slot) }
block_set_slot(value) {
_slot=value
return this
}
construct new(block, slot) {
_block = block
_slot = slot
} //new
block { _block }
} //BlockInstModifierData
return BlockInstModifierData
} //instance_type
block { _block }
count { Block.get_count(_block) }
add() { Block.add(_block) }
append(other_block) { Block.append(_block, other_block) }
each(c, fn) {
for(i in 0 ... c) {
fn.call(0, _inst.block_set_slot(i))
}
} //each
[slot, inst] { _inst.block_set_slot(slot) }
[slot] { _inst_type.new(_block, slot) }
} //BlockModifierData
//`modifiers/spine_renderer > world` types
class ModifierWorld {
construct new() {
} //new
} //ModifierWorld
//`modifiers/spine_renderer > world` compilers
class ModifierWorldCompiler {
construct new() {
}
bytes_count(instance) {
var size = 4 //version
size = size + 0
return size
} //bytes_count
validate(from_source_id, elements) {
var fields = {
"type": false, //:luxe:internal
"uuid": false, //:luxe:internal
"luxe.self.modifier": false, //:luxe:internal
}
for(element in elements) {
var instance = element.value
for(field in instance) {
if(fields[field.key] == null) {
Fiber.abort("node `%(element.key)` in `%(from_source_id)` has extra field `%(field.key)`")
} //if not found
} //each field
for(field in fields) {
var required = field.value
if(required && instance[field.key] == null) {
Fiber.abort("node `%(element.key)` in `%(from_source_id)` is missing a required field `%(field.key)` (and the field has no default value)")
}
} //each field
} //each element
} //validate
write(compiler, instance, out) {
//version
out.write_int32(0)
return out
} //write
bytes_count_block() {
return 8
} //bytes_count_block
write_block(compiler, out) {
//source id
out.write_uint32(compiler.string.hash("modifiers/spine_renderer > world"))
//fields count
out.write_int32(0)
} //write_block
write(instance) {
var size = bytes_count(instance)
var out = Byter.new(size+8)
out.write_string("LUXEMWLD")
write(instance, out)
return out
} //write
} //ModifierWorldCompiler
//`modifiers/spine_renderer > world` block types
class BlockModifierWorld {
field { "spine_renderer" }
source { "modifiers/spine_renderer > world" }
construct new(block) {
_block = block
_inst_type = instance_type
_inst = _inst_type.new(_block, 0)
}
construct new() {
_block = Block.create()
_inst_type = instance_type
_inst = _inst_type.new(_block, 0)
Block.set_type(_block, "modifiers/spine_renderer > world")
} //new
instance_type {
class BlockInstModifierWorld {
slot { _slot }
entity { Block.get_handle(_block, _slot) }
block_set_slot(value) {
_slot=value
return this
}
construct new(block, slot) {
_block = block
_slot = slot
} //new
block { _block }
} //BlockInstModifierWorld
return BlockInstModifierWorld
} //instance_type
block { _block }
count { Block.get_count(_block) }
add() { Block.add(_block) }
append(other_block) { Block.append(_block, other_block) }
each(c, fn) {
for(i in 0 ... c) {
fn.call(0, _inst.block_set_slot(i))
}
} //each
[slot, inst] { _inst.block_set_slot(slot) }
[slot] { _inst_type.new(_block, slot) }
} //BlockModifierWorld