|
|
如题,即如果store中存放有4种entity分别为part1,part2,part3,part4,每次需移动数量分别为4,3,1,1。按下面语句是否可行,不知道怎修改,或者类似语句该如何编写,向大家求救。$ H# w+ \" p! U+ E. j
is 7 k9 M2 ~2 i6 N2 H( \
a,b:integer;
! X1 d; L2 e9 m1 _/ a. ldo8 D+ S3 I9 N9 a d- G. ~
if store.cont.name="part1" then3 \$ k. A0 a) R- f9 q
for a:=1 to 4 loop: u# y* a7 L: ]& Q! c& y# ?# K
store.cont.move;
$ s. |0 y8 R. Z) c' v! A next;
( N) Y- [7 y; H# K, U elseif store.cont.name="part2" then
; [( c: e& L* j! ~ for b:=1to 3 loop0 E3 S7 b- n' u& S
store.cont.move;0 _+ a! D: [. t- F- u
next;
$ u; j. N. e6 W w elseif store.cont.name="part3" then
2 [# T' J$ w g0 |0 g+ K* |; K store.cont.move;- P h) _; L8 ^2 V
elseif store.cont.name="part4" then& e! s) ?5 J' s' h8 I
store.cont.move;8 Z$ A' q0 D6 D H
end;" K6 Y' E7 X4 J! S2 R ]
end; |
|