Updated project to luxe 2025.11.1
This commit is contained in:
@ -29,7 +29,16 @@ class Modifier {
|
||||
editor_tick(delta: Num) : None {}
|
||||
|
||||
get(entity: Entity) : Data { Mod.get(entity, Modifier.id) }
|
||||
each(fn: Fn) {
|
||||
|
||||
list() : List {
|
||||
var list = []
|
||||
each {|entity: Entity, unused|
|
||||
list.add(entity)
|
||||
}
|
||||
return list
|
||||
}
|
||||
|
||||
each(fn: Fn) : None {
|
||||
var count = attached_count
|
||||
for(idx in 0 ... count) {
|
||||
var inst = Block.get_at(_block, idx)
|
||||
@ -38,7 +47,8 @@ class Modifier {
|
||||
fn.call(entity, data)
|
||||
}
|
||||
}
|
||||
each(start: Num, count: Num, fn: Fn) {
|
||||
|
||||
each(start: Num, count: Num, fn: Fn) : None {
|
||||
for(idx in start ... start + count) {
|
||||
var inst = Block.get_at(_block, idx)
|
||||
var data = Block.instance(_block, inst)
|
||||
@ -58,6 +68,7 @@ class API {
|
||||
static system(entity: Entity) : System { World.get_system(Entity.get_world(entity), Modifier.id) }
|
||||
static count(world: World) : Num { system_in(world).attached_count }
|
||||
static each(world: World, fn: Fn) : System { system_in(world).each(fn) }
|
||||
static with(world: World) : List { system_in(world).list() }
|
||||
static get : APIGet { APIGetter }
|
||||
static set : APISet { APISetter }
|
||||
static connect : APIWireConnect { APIWireConnects }
|
||||
@ -76,6 +87,7 @@ class Fields {
|
||||
static target_speed : String { "target_speed" }
|
||||
static time_since_grounded : String { "time_since_grounded" }
|
||||
static is_grounded : String { "is_grounded" }
|
||||
static movement_active : String { "movement_active" }
|
||||
}
|
||||
|
||||
import "luxe: world/states" for AState, States, Op
|
||||
@ -106,6 +118,7 @@ class APIGet {
|
||||
target_speed(entity: Entity) : Num { Modifier.get(entity).target_speed }
|
||||
time_since_grounded(entity: Entity) : Num { Modifier.get(entity).time_since_grounded }
|
||||
is_grounded(entity: Entity) : Bool { Modifier.get(entity).is_grounded }
|
||||
movement_active(entity: Entity) : Bool { Modifier.get(entity).movement_active }
|
||||
}
|
||||
|
||||
class APISet {
|
||||
@ -121,6 +134,7 @@ class APISet {
|
||||
target_speed(entity: Entity, value: Num) { Modifier.get(entity).target_speed = value }
|
||||
time_since_grounded(entity: Entity, value: Num) { Modifier.get(entity).time_since_grounded = value }
|
||||
is_grounded(entity: Entity, value: Bool) { Modifier.get(entity).is_grounded = value }
|
||||
movement_active(entity: Entity, value: Bool) { Modifier.get(entity).movement_active = value }
|
||||
}
|
||||
|
||||
var APIGetter = APIGet.new()
|
||||
|
||||
@ -29,7 +29,16 @@ class Modifier {
|
||||
editor_tick(delta: Num) : None {}
|
||||
|
||||
get(entity: Entity) : Data { Mod.get(entity, Modifier.id) }
|
||||
each(fn: Fn) {
|
||||
|
||||
list() : List {
|
||||
var list = []
|
||||
each {|entity: Entity, unused|
|
||||
list.add(entity)
|
||||
}
|
||||
return list
|
||||
}
|
||||
|
||||
each(fn: Fn) : None {
|
||||
var count = attached_count
|
||||
for(idx in 0 ... count) {
|
||||
var inst = Block.get_at(_block, idx)
|
||||
@ -38,7 +47,8 @@ class Modifier {
|
||||
fn.call(entity, data)
|
||||
}
|
||||
}
|
||||
each(start: Num, count: Num, fn: Fn) {
|
||||
|
||||
each(start: Num, count: Num, fn: Fn) : None {
|
||||
for(idx in start ... start + count) {
|
||||
var inst = Block.get_at(_block, idx)
|
||||
var data = Block.instance(_block, inst)
|
||||
@ -58,6 +68,7 @@ class API {
|
||||
static system(entity: Entity) : System { World.get_system(Entity.get_world(entity), Modifier.id) }
|
||||
static count(world: World) : Num { system_in(world).attached_count }
|
||||
static each(world: World, fn: Fn) : System { system_in(world).each(fn) }
|
||||
static with(world: World) : List { system_in(world).list() }
|
||||
static get : APIGet { APIGetter }
|
||||
static set : APISet { APISetter }
|
||||
static connect : APIWireConnect { APIWireConnects }
|
||||
|
||||
Reference in New Issue
Block a user