def move.found
ezx@1.11.0.0 · src/ws/moved.bend:127
import ezx@1.11.0.0/src/ws/moved.bend as Moved
import Base
import ezx@1.11.0.0/src/ledger/upgrade.bend as U
127
128
129
130
131
132def move.found(
133 found: Maybe<&2, Held>,
134 +base: String,
135 +old: String,
136 +only: String,
137 rest: List<&2, Shift>
138) -> List<&2, Shift>:
139 match found:
140 case None{}:
141 rest
142 case Some{hd}:
143 Held{_hp, +name, +new} = hd
144 move.put(Bool.and(Bool.not(String.eq(new, old)),
145 Bool.or(U.chosen(only, name), Bool.not(String.eq(new, base)))), name, old, new, rest)