|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。5 G" H+ [0 @8 e$ m, K! G
is
Z8 t) a, l; u9 h$ m) _ a,b:integer;
: P. n: G% H* V3 edo/ X6 G2 m% G; W" V
if store.cont.name="part1" then
- \2 ]/ R u3 T$ j for a:=1 to 4 loop; m( `/ A ~; I5 c4 n
store.cont.move;
5 Z& G1 x+ ^/ O next;( c5 f, p) }/ c: l- e- n$ }
elseif store.cont.name="part2" then
/ P! ?; ]: l9 E for b:=1to 3 loop6 O% l* k, G) O" ^2 p6 D# b
store.cont.move;
$ _3 m4 o% x) d2 T' v: S next;
; _' e; e, `: H5 `6 m5 O elseif store.cont.name="part3" then
& e3 L& G; k& f, s store.cont.move;% t& z. n( h1 k; ^- p. C, T
elseif store.cont.name="part4" then
# L2 g# c, n2 h store.cont.move;6 ?0 o) c/ q0 c& H
end;
4 e! C' H0 Q5 }- T# c end; |
|