|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。
0 j7 c$ \2 |& Z {is 9 |5 C& r. ?6 M4 G% p' o
a,b:integer;2 p( ~3 ^: J/ P& W# P2 K4 ]0 g
do, {! B/ b8 a* p( k+ U
if store.cont.name="part1" then+ Q0 o4 `# y6 e; T' _3 p' ?" X
for a:=1 to 4 loop
9 m4 z/ ~1 v6 S# u4 Z store.cont.move;7 R# p6 L, \- B, Z5 L: U
next;' v2 N4 K1 Q; x. u$ _5 e
elseif store.cont.name="part2" then% i3 i; F, Y3 [8 Y% g5 O
for b:=1to 3 loop# }* D" `: L, G6 `8 R1 C* y
store.cont.move;
, n/ [1 M3 [" d+ S9 E next;
, W1 d. |( f% M6 h$ h# G' J elseif store.cont.name="part3" then
9 Z3 R, C5 a B- U, ~' } store.cont.move;
+ z, r$ `5 i7 R: W: n' D4 N elseif store.cont.name="part4" then [+ G# V* m% N: f; ~ x" P2 _
store.cont.move;
6 t/ {, x: z, l+ m" U, _ end;" }% o+ z8 e7 m; K" x* q$ N
end; |
|