|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。% J% u: g, {/ ~' Y3 r7 B
is
' ^8 O* N. C7 [, Y a,b:integer;
7 G# B; K! k. J7 v+ _/ P/ Cdo
Z y* U0 G# O9 ^. E U; s5 X if store.cont.name="part1" then
$ G: D" H3 f/ M* t for a:=1 to 4 loop' n# {/ ~; N. `, j$ y% _$ }
store.cont.move;
) q: Z4 f2 o1 x( L4 ~ next;
4 Z3 n3 F" B/ b- f) i elseif store.cont.name="part2" then
/ Z# z5 B" n- m+ [% s7 F, d" _ for b:=1to 3 loop" L1 _$ V3 {0 F3 A5 Z6 ?7 H
store.cont.move;
0 x- j1 |, v& e4 }# u next;
' |4 P0 p# {8 w! m" K- [, V* D% b elseif store.cont.name="part3" then
" `7 a* m4 ~' s+ m' C7 c H# e store.cont.move;, u: V! D# a; B9 N J
elseif store.cont.name="part4" then5 P' z# q1 u' @9 H
store.cont.move;# O* ]( W1 c" V$ _
end;+ O8 A7 m G: C! ]# B0 x+ k
end; |
|