|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。
# i9 K4 c( D1 B, pis # n0 R- ]3 l9 i8 V
a,b:integer;
9 l) `) Q+ c9 Udo
, d% z% W G$ Z& Q if store.cont.name="part1" then! V; h0 ]2 _* |- P
for a:=1 to 4 loop5 i+ \ j! T2 A; r" Z7 {. ]
store.cont.move;7 d/ e+ s! I7 C' |- j* @, d0 @; z3 C
next; L0 l8 i! r5 R; d W
elseif store.cont.name="part2" then
. C* F3 x# \# t! G! A8 C for b:=1to 3 loop
- e( A' o3 G, R3 R store.cont.move;3 V$ w p$ B3 M, a8 W
next;8 R( V3 O/ |* x/ f* x a
elseif store.cont.name="part3" then
1 Z3 L+ t2 c. C/ F+ y9 g4 v store.cont.move;
6 U0 s) O$ Q( D( a elseif store.cont.name="part4" then
7 r' \) N, n. w0 p store.cont.move;# l `$ l+ o" S* M. D" L+ y/ L
end;
3 s) l z+ e5 j" c0 M3 ^8 E end; |
|