refactor(packages): 0.R5 - a question no longer starts its state - 64 lazy starts ('if st.x == null { st.x = ... }' inside a getter) are the state's defaults, gear__ensure is gone, and ludic migrate state --tighten took mut off 208 package parameters: things_all, thing_find, gear_charge, gear_level, jobs_state and the rest read
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
54f5efb23f
commit
9862ec82e3
102 changed files with 320 additions and 351 deletions
|
|
@ -21,7 +21,7 @@ export function thing_prompt(t: Thing) -> string {
|
|||
}
|
||||
|
||||
# the kind does what using it does; the use is a fact whatever the kind made of it
|
||||
export function thing_use(things_st: mut ThingsState, t: Thing) -> void {
|
||||
export function thing_use(things_st: ThingsState, t: Thing) -> void {
|
||||
if t == null or not thing_kind_ok(t.kind) { return }
|
||||
let k = ThingKinds[t.kind]
|
||||
th_fact(things_st, THING_USED, t)
|
||||
|
|
@ -46,7 +46,7 @@ export function thing_is_personal(t: Thing) -> bool { return thing_kind_ok(t.kin
|
|||
export function thing_is_put_down(t: Thing) -> bool { return ThingsWorld.put_down(t) }
|
||||
|
||||
# every active Thing whose kind ticks, `hours` of the world's clock on
|
||||
export function things_tick(things_st: mut ThingsState, hours: float) -> void {
|
||||
export function things_tick(things_st: ThingsState, hours: float) -> void {
|
||||
let all = things_all(things_st)
|
||||
for i in 0 .. len(all) {
|
||||
let t = all[i]
|
||||
|
|
@ -58,7 +58,7 @@ export function things_tick(things_st: mut ThingsState, hours: float) -> void {
|
|||
|
||||
# a restock: every Thing the world grew is back, and loses its `used` unless its kind keeps it;
|
||||
# what was put down is left as it is
|
||||
export function things_restock(things_st: mut ThingsState) -> void {
|
||||
export function things_restock(things_st: ThingsState) -> void {
|
||||
let all = things_all(things_st)
|
||||
for i in 0 .. len(all) {
|
||||
let t = all[i]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue