|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。 q/ [* ~9 Z$ g9 u- @0 \) W4 B
is ( `. G( R8 f! W8 A0 G) v6 V
a,b:integer;( ~! M: Q# Q: x
do" N+ ^/ s5 c: j2 \
if store.cont.name="part1" then! f. g5 ]2 d& @% x$ n2 w1 W
for a:=1 to 4 loop$ q4 w( H" ^. v
store.cont.move;
1 O7 O4 R7 Z6 ]( q4 Y) @$ l* ^ next;" k" i9 _4 R+ a1 f
elseif store.cont.name="part2" then* g. l/ t; T4 O( r% n& F
for b:=1to 3 loop
, `4 D0 D1 S7 Q8 l4 ?5 T store.cont.move;
/ G1 l, B4 `0 Z/ D9 f7 } next;
1 t4 l0 X& C- n9 ] elseif store.cont.name="part3" then/ x3 k. k8 v3 d! z
store.cont.move;2 ^. E0 n8 I. e% o4 J4 w- e
elseif store.cont.name="part4" then
. X8 k# {; O( {% m1 f store.cont.move;
- a; O W; G3 H$ @$ p0 C5 N end;4 v# W1 K9 k; x: N; F; G8 H7 `$ A
end; |
|