|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。! L& e2 U/ a7 B* N$ X, G$ i' T6 q
is 0 r2 F7 J7 Y- w$ Z i7 S
a,b:integer;
3 c* s* Z& n7 u! f, A9 mdo8 {# f: c c) j* k0 s6 c
if store.cont.name="part1" then, i' G% c l6 @
for a:=1 to 4 loop% L: P5 M2 o9 _4 D( A1 s2 {
store.cont.move;
, K' ?4 G7 D0 Q8 g2 \2 d# e next;4 N$ m$ w1 B3 x N5 I: r3 A
elseif store.cont.name="part2" then7 s- |0 o: x$ m, n$ l; k
for b:=1to 3 loop
' s/ a: l+ o( ` Q store.cont.move;1 d! _6 O$ b' j" Z" \0 W# ?
next;
! U6 `4 q1 N- T+ d+ C elseif store.cont.name="part3" then2 q, S9 ]6 o7 ^! R/ B; |2 l
store.cont.move;1 C8 A! W1 Y" W, i! Y
elseif store.cont.name="part4" then. C8 ]* U8 m+ @
store.cont.move;
4 S |& O: p0 c( f end;
0 l2 c4 t8 o0 G( n9 ? end; |
|